5 ms·
- Awk is defined in POSIX - Awk is on more systems than Perl - Awk has more implementations than Perl
by rlonstein 2y ago
- Awk is defined in POSIX
- Awk is on more systems than Perl
- Awk has more implementations than Perl
- chrsig 2y agoawk is also a much smaller language than perl, so it's generally less effort to teach, learn, and read.
- Chris2048 2y agoIs it not possible to learn a subset of perl?
- chrsig 2y agoLearning any language more or less starts with learning a subset of it. Asking a new hire to "learn awk" vs "learn perl" have two very different time investments attached to them. Tasking someone with "learning a subset of perl" begets the question "what subset?", and a very exhausting conversation with someone(s) routinely asking "so?" follows. After spending a large amount of time re-litigating which subsets of perl features we want that awk already supplies.
- kazinator 2y agoWhich subset, and how do you ensure that every example you come across and everyone you work with sticks to that subset?
- Chris2048 2y ago> Awk is defined in POSIX so? > Awk is on more systems than Perl By what metric? > Awk has more implementations than Perl so?
- rlonstein 2y agoWhatever you think my opinion is of Perl you're probably wrong and the tone of your advocacy is kind of odd. Awk is older and as a part of POSIX the version found on unix-like environments will be (outside of extensions) compatible with others. If one or one without the extensions you want isn't present you can choose an implementation, even one in Go and it'll work. Perl, and I've been writing Perl since Perl4, doesn't have those characteristics. It's a much more powerful language that has changed over the years and it is not always present by default on a unix-like system. Because the maintainers value backward compatibility, even scripts written on Perl5.005 have a fair chance of working on a modern version but it's not assumed (and you shouldn't assume anything about modules). Because Awk is fossilized, you can assume that.
- Chris2048 2y agoThe first and last items in your list provide no reason why they are relevant, there is no "tone", nor "advocacy" - it's not "odd" to ask for that context, as given here.
- kazinator 2y agoAwk is found in small-ish embedded systems that don't have no reason to waste space on Perl or anything like it. One reason for this is that the popular BusyBox project includes an Awk implementation: BusyBox Awk. Pretty much everywhere there is BusyBox, there is an Awk, unless someone went out of their way to compile it out of the BuxyBox binary.
- emmelaich 2y agoPOSIX not really relevant, more systems? Debatable. More implementations could be seen as a negative. Perl is more regular than Awk for the simple cases and is more usable for anything that isn't merely iterating over input. Of course, you shouldn't any of awk/perl/shell for tasks that aren't being run by you or are over say 20 lines long.