hiAndrewQuinn 19 hours ago

(I'm assuming you mean the latest Perl actually called Perl, and not its successors.)

In a vacuum I wouldn't recommend Perl over first learning the most common languages and technologies of today. I'd gain some familiarity with Python first at a minimum. But it does have some interesting niche advantages you might want to look into more down the road.

Perl 5 has been on the same major version for 30 years now [1], and hence has had a truly enormous amount of training data for LLMs to glomp onto. Since Perl is also primarily thought of as a "scripting-plus" language, something to reach for when Bash isn't cutting the mustard but a 'real program' feels too heavyweight, a lot of its use cases are very much in the LLM one-shot sweet spot. [1]

Perl 5 also has the unique advantage of being installed system-wide by default on more Unix machines than you might expect. It's sitting there quietly on Debian for you right now [2]. It's even the scripting-plus language of choice for OpenBSD!

You would think being "the same" for 30 years would also mean Perl almost accidentally performs really well on modern machines, which have a few orders of magnitude more resources to throw around. I haven't really found this to be that noticeable, though, and if I actually cared about performance in those domains I'd probably stick to the smallest tools I could work with first. Then again, a vanilla Perl 5 program might be even more cross-platform than a vanilla shell script is; shells come and go, but Perl 5 is forever, apparently.

[1]: https://hiandrewquinn.github.io/til-site/posts/llms-make-per...

[2]: https://hiandrewquinn.github.io/til-site/posts/what-programm...

  • not-so-darkstar 18 hours ago

    Yes, I meant Perl 5. Raku is a totally different beast. I got interested in Perl exactly because of its scripting capabilities. I want to replace Bash, sed, awk, etc. with a single, more powerful, language (without having to remember a billion flags/strange syntax).

    I think it's fascinating how well it integrates in a Unix system and I find it very nice how concise it can get.

    • hiAndrewQuinn 15 hours ago

      I see! If that's your motivation then Perl sounds like it could be a nice fit for you. It is indeed exceptionally Unixy in my view.

dapperdrake 19 hours ago

Depends on your use-cases.

Perl went through a few backwards-incompatible changes and Raku (née Perl 6) and has eroded its library base and user base.

Kind if like the transition from Python 2 to Python 3 stranded part of the ecosystem.

The backwards compatible systems like Linux user space ABI, Java (ruffled feathers with Java 9), TeX/LaTeX and Win32 will stick around the longest due to accreting libraries. Golang is on its way there. Python 3 may have enough important libraries now to also stick with them. If Zig does their job right, then they also have chances.

For Java look at NTS from Java 1.2 days in 2001, where apparently even the old jar files still load on new JVMs: https://news.ycombinator.com/item?id=40753417

sandreas 19 hours ago

Perl is a nice language that can do a lot of things very well.

However, for landing a job or doing more modern stuff like AI or web, I'd probably recommend

  Python
as a first language, unless there is a specific reason to learn perl
  • not-so-darkstar 18 hours ago

    It's not my first language. I already know Python and I think it's very boring.

    It's mostly for personal reasons regarding design of PLs and to be able to learn a new way to think about programming.

    • sjducb 12 hours ago

      If you’re bored of Python go for a language that has very different paradigms.

      Think C# / Java to learn about OOP

      Scala to learn functional programming

      Golang for concurrency and using the type system to handle exceptions.

      Perl is very similar to Python so won’t teach you much.

    • sandreas 17 hours ago

      Maybe then it would be a good idea to focus on building a compiler yourself... could be a toy compiler for an esoteric language or a small LISP.

rl1987 16 hours ago

No-ish, unless you specifically want to work with Perl codebases (e.g. in bioinformatics). By and large, Python has pretty much replaced Perl for generic scripting work.

brudgers 12 hours ago

Yes, because it does not matter what language a young person learns.

Or an old person.

Learning is a skill acquired through experience.

It is not an optimization problem.

AnimalMuppet 12 hours ago

Perl is interesting because it was written by a linguist. It's the only language I know of where you can say "it".

Here's what I mean: I'm talking to another developer. I say, "Read in a line of input. If it ends in a newline, remove the newline." I can talk like that to a developer.

But when I talk to a computer, it says, "Read in a line of input? From where? And put it where? If 'it' ends in a newline? If what ends in a newline?" You can't talk to a computer that way...

Except in Perl. In Perl, you say, "Read in a line of input. I didn't specify where, so read in from the standard place[1]. I didn't specify where to put it, either, so put it in the default variable[2]. Then call chomp, which if I don't specify, will operate on the default variable."

[1] The default input is the files specified as command-line arguments, in order.

[2] The default variable, $_, is used when you don't specify a different variable. $_ plays the linguistic role of "it" - it's what you're talking about when you don't specify what you're talking about.

  • dapperdrake 3 hours ago

    Doug Hoyte looks at anaphoric macros in his book Let Over Lambda.

    Hylang also has thise built in. IIRC it was the anaphoric threading macro "a->".

    Apparently this language construct is called an anaphora.