Readit News logoReadit News
not-so-darkstar commented on Ask HN: Hands-On Guide to Writing Parsers?    · Posted by u/not-so-darkstar
not-so-darkstar · 2 months ago
bump
not-so-darkstar commented on Ask HN: Is it still a good idea to learn Perl for a young developer?    · Posted by u/not-so-darkstar
sjducb · 2 months 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.

not-so-darkstar · 2 months ago
All of the languages you listed are inside my category of boring (Java and C# ??).

I know functional programming from Haskell, OOP from C++ and for rest I use Python. These are the languages I would prefer for each paradigm but I also know Java and C.

I think that Perl is different from all the languages I listed and that's why I wanted to study it.

not-so-darkstar commented on Ask HN: Is it still a good idea to learn Perl for a young developer?    · Posted by u/not-so-darkstar
AnimalMuppet · 2 months 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.

not-so-darkstar · 2 months ago
This is what I'm talking about. Your response made me even more eager to learn it!
not-so-darkstar commented on Ask HN: Is it still a good idea to learn Perl for a young developer?    · Posted by u/not-so-darkstar
sandreas · 2 months 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 · 2 months 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.

not-so-darkstar commented on Ask HN: Is it still a good idea to learn Perl for a young developer?    · Posted by u/not-so-darkstar
hiAndrewQuinn · 2 months 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 · 2 months 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.

not-so-darkstar commented on Fixing the mechanics of my bullet chess   jacobbrazeal.wordpress.co... · Posted by u/tibbar
not-so-darkstar · 2 months ago
I think speed is important only for ratings in the lower end.

u/not-so-darkstar

KarmaCake day17June 7, 2025View Original