News for hackers. Stuff that matters.
Re:Perl first commit: a “replacement” for Awk and sed by imron on Saturday July 08, 2023 @08:53PM (#36650322)
> Yes, awk and sed were replaced by Perl,

I still use awk and sed semi regularly. I haven’t used Perl in over a decade.

Re:Perl first commit: a “replacement” for Awk and sed by idlewords on Saturday July 08, 2023 @09:07PM (#36650408)
Sounds like you were also replaced by Perl.
Re:Perl first commit: a “replacement” for Awk and sed by natch on Saturday July 08, 2023 @09:22PM (#36650515)
…that you’re aware of.
Re:Perl first commit: a “replacement” for Awk and sed by eigenvalue on Saturday July 08, 2023 @10:13PM (#36650845)
Agreed. I would turn to Python for anything more involved that couldn’t be done very directly and efficiently using awk/sed. I would never use Perl for anything.
Re:Perl first commit: a “replacement” for Awk and sed by kdmccormick on Saturday July 08, 2023 @11:01PM (#36651077)
Same, but if there were no Python/Ruby/etc, I would probably be reaching for Perl quite a lot.
Re:Perl first commit: a “replacement” for Awk and sed by kristopolous on Saturday July 08, 2023 @11:34PM (#36651257)
1980s awk and sed aren't the same as the 2020s version.

They've become much more useful because of the influence of things like perl.

Re:Perl first commit: a “replacement” for Awk and sed by tannhaeuser on Sunday July 09, 2023 @12:43AM (#36651583)
Awk today is very much the same language it was in 1977 when it was introduced. Comparing your links with today's POSIX awk manpage doesn't yield a single thing Perl brought to awk. At best, while JavaScript syntax is even based on awk, you could say JavaScript regexpes are based on PCRE, and it wasn't clear whether use of capture groups/back references makes Perl regexpes accidentally Turing.
Re:Perl first commit: a “replacement” for Awk and sed by kristopolous on Sunday July 09, 2023 @02:04AM (#36652000)
POSIX, right. POSIX sucks. POSIX anything is stuck 30 years ago. Nobody in 2023 really uses POSIX awk on some commercial UNIX like IBM AIX, they use GNU awk, that's the modern one I'm talking about https://www.gnu.org/software/gawk/manual/html_node/index.htm...
Re:Perl first commit: a “replacement” for Awk and sed by tannhaeuser on Sunday July 09, 2023 @03:14AM (#36652350)
What are you talking about? There is no POSIX awk implementation, just a language spec and nawk AKA the one true awk. As shipped on Mac OS, whereas Debian ships mawk in addition to gawk. gawk is just much slower and unfortunately also buggy (crashes on a non-"C" locale with complex regexpes).
Re:Perl first commit: a “replacement” for Awk and sed by kristopolous on Sunday July 09, 2023 @03:34AM (#36652444)
Right, "the one true awk" corresponds to a book written in 1988, very explicity. https://github.com/onetrueawk/awk

I was incorrect about 30 years. It's actually 35.

You were the one that that said POSIX awk to begin with, I was using your terms. I understand what you meant, why don't you?

As far as shitting on the GMU tools, I don't think I've seen someone do that in decades. Are you writing this on like a HP 9000 K-class?

This is not a productive conversation. You can live life however you want. We are definitely at an impasse. I'm off to bed.

Re:Perl first commit: a “replacement” for Awk and sed by kdmccormick on Sunday July 09, 2023 @09:50AM (#36654433)
Well, I look at the POSIX standards whenever I want to write shell scripts and Makefiles that work on both Linux and macOS. Which, in my current role, is often enough that I am driven crazy by how far POSIX is behind GNU tooling...
Re:Perl first commit: a “replacement” for Awk and sed by kristopolous on Sunday July 09, 2023 @03:27PM (#36657981)
Yep. Funny enough, Linux is actually not POSIX certified

POSIX was initially a bunch of the Unix vendors getting together in the 80s saying "this shit is crazy let's find something we can agree on" and then the conflicts of trying to still have a differentiating But Also compatible product.

As a result, POSIX was intentionally kneecapped by all the players but not enough to make it completely worthless.

By the 2010s I decided to simply ignore it and if something breaks on FreeBSD or whatever, make the decision then whether to support it or not.

Re:Perl first commit: a “replacement” for Awk and sed by kdmccormick on Monday July 10, 2023 @01:00AM (#36662304)
Got it. I'm the dev tools guy at my job right now, and we have a mix of Linux and Mac users, so I've gotta make sure that any shell I write works on both. For me, POSIX seems to be a good indicator of the intersection between the two OSs, even though the true intersection is neither a superset nor subset of POSIX (eg, Mac has bash, which isn't POSIX shell). Oh well. It's close enough to be useful, and I test it all manually anyway.
Re:Perl first commit: a “replacement” for Awk and sed by tannhaeuser on Tuesday July 11, 2023 @05:41AM (#36678514)
Mac OS ships zsh since 10.15 as default shell as I'm sure you know, with the (restricted ksh subset called) POSIX shell pretty much the intersection of what works on both Linux and Mac OS. There you have the usefulness of POSIX/SUS.
Re:Perl first commit: a “replacement” for Awk and sed by tharne on Sunday July 09, 2023 @09:59AM (#36654492)
> I still use awk and sed semi regularly. I haven’t used Perl in over a decade.

Same. Awk and Sed are delightful little tools that have aged exceptionally well.

Re:Perl first commit: a “replacement” for Awk and sed by grumpyprole on Sunday July 09, 2023 @11:24AM (#36655227)
They are also constrained languages which gives many advantages. POSIX regex will always execute in O(n), Perl "regex" are potentially exponential and can be a security risk in certain situations.
Re:Perl first commit: a “replacement” for Awk and sed by 2colours on Monday July 10, 2023 @10:10AM (#36666699)
Well, that's at least an actual argument, even though POSIX regex would have never proven so useful in a variety of use cases.

Other than that, I'm completely shocked that somebody would praise sed or awk in well into the 21st century. Turing-complete languages barely capable of properly solving any problem that has any sort of algorithmic complexity, let alone one that requires proper data types, variables or interacting with any sort of system. Really, you can do that in Perl (even in Raku) without your couple-of-liner horribly breaking down once you need some custom logic to it. Oh, and it will even resemble programming languages, not some hieroglyphs left behind by aliens.

Re:Perl first commit: a “replacement” for Awk and sed by 2colours on Monday July 10, 2023 @10:01AM (#36666595)
What is the reason for that? I think they should be long gone for the lack of proper data structures, if nothing else.