4 ms·
Perl is one of those power tools(as recommended in Let Over Lambda, together with vim and Lisp), if you learn it well enough to be good at it, and early enough
by kamaal 2y ago
Perl is one of those power tools(as recommended in Let Over Lambda, together with vim and Lisp), if you learn it well enough to be good at it, and early enough in your career- You really have a mad productivity work horse. Its really one of those things which save tons of time and effort. A bit like O(1) hack of the productivity world.
Perhaps at the core of this just how many what we called regular programming tasks are just knowing how to work with text and unixy operating system. Perl is just unbelievably awesome at this. Another big edge of Perl is commitment to backwards compatibility, most people who learned Perl early in their careers decades back can use it on-demand basis. Its universally installed, fast and scripts written from the earliest days continue to run with 0 changes, despite endless OS upgrades.
Early enough in the timeline Perl was full unix hackers, and you learned a lot from them, this culture further bolsters Perl's productivity credentials. Not a week passes, that I have to whip up a Perl script to do something for someone has a 2 people and a month budget to do. And they are often amazed it can be done this quickly.
CPAN is another big edge Perl has. No other language apart from JS/npm ecosystem has anything close, and these are basically competing in very different domains so to that end CPAN really doesn't have a competition till date.
If you are looking to build using Perl do checkout the Camel book and HOP by mjd.
- alfiedotwtf 2y agoSadly I think Node and Python have long taken over CPAN. But apart from that, I was nodding through your whole comment… Perl really is a super power. POSIX at your fingertips!
- kamaal 2y agoNode/NPM definitely is on-par with CPAN. But pip isn't even close. The real deal with Perl is you not only get bleeding stuff, you get all kind of obscure and rare libraries. Its not that you can't do that in Python. Its just that the culture in Python world isn't made up of people who think about those problems or even in that dimension. Its a great language for writing all variety of apps. Perl is the og hacker's language. Python is awesome too, but its not really what Perl is. Most of the bad rep Perl gets is because programmers who only interact with http endpoints and databases tend to not understand where else it could be useful. Like even the regexes. They sound like a pain, until you have to do non trivial string manipulation tasks. Then you discover, regexes do it a lot better than cutting and slicing strings some 100s of times.
- canvascritic 2y agoI'll be frank: I think this idea that ${faveLang} is for misunderstood geniuses who truly understand computers where mainstream languages like Python are for dunces who only know how to glue together APIs is a large part of why such languages as Perl are nearing extinction. It turns out that there are people working on challenging problems in domains you've never heard of in Python -- and pretty much every other language. Give it a rest In the real world, the ability of a lone genius to cobble together a script in an hour is actually not that much of an edge -- it is more important for people to write something that others can understand and maintain. If you can do that in Perl, great, and if writing Perl makes you happy: also great. But beware that smug elitism turns people off, it kills communities and also tends to signal a pathological inversion of priorities. All this should be in service to people, after all
- kamaal 2y ago>>In the real world, the ability of a lone genius to cobble together a script in an hour is actually not that much of an edge Any macro/multiplier is that way. You don't miss it, until some one shows you how to do it. In the last six months alone the scenarios where I had to call upon Perl to help slam dunk a thing insanely laborious are dozens in number. Its just that if you don't know this, or don't know it exists, you grow up being comfortable doing manual work with comfort. Sheer amount of times, I have seen some one spend like half a day doing things which can be done using a vim macro in like seconds is beyond counting at this point.
- stouset 2y agoThe superpower here is a scripting language, not Perl specifically.
- kamaal 2y agoSometimes a language/tool gets to evolve with the operating system right at their birth. The relationship with between Unix, vim, and Perl is that way. This is a unique combination, which I don't think will ever change. Unless of course we move away from Unixy operating systems to something entire new.
- liontwist 2y agoI’m into lisp and vim. I did one small project with Perl but wasn’t excited. I was hoping for bash 2.0 but the shell integration wasn’t great. Seems like python is a similar feature set, less exotic, and has great libraries. Anyway? What did I miss? anything I should take a second look at?
- dartos 2y agoRaku is basically perl 6 and has some features that blew my mind when I tried it a few years back. Never really did much with it, but it was enjoyable to learn.
- kjs3 2y agoThis encapsulates every conversation I have ever had with someone who tried Perl 6: Tried it, was blown away with [some aspect of it], never found anything practical to do with it, never used it again.
- RandalSchwartz 2y agoI think I even reference that in the talk... Dart is everything I wanted from Perl 6, which is why I'm happy to be coding in Dart now.
- kqr 2y agoIf you're into Lisp you're probably not missing that much. The main reason I use Perl over Lisp is that Perl is preinstalled nearly everywhere, whereas Lisp is not.
- BoingBoomTschak 2y agoYou should really look at Tcl if coming from Lisp and wanting a bash successor. Tcl (8.5) is also preinstalled on MacOS.
- dismalaf 2y agoJust curious, what does Perl give you over Ruby if anything? I learned Ruby first, always heard it was strongly inspired by Perl (as well as Smalltalk), and it provides all the benefits you mentioned, I think.
- kamaal 2y agoMostly because Ruby isn't as ubiquitous and its not closer to C, the way Perl is. Ruby really is competing with Python in problem domain space not Perl.
- stouset 2y agoFrankly nothing. Ruby is a strict improvement over Perl in almost every way. I cut my teeth on Perl and I still remember it fondly. But there is no reason to learn Perl (5) over Ruby. Maybe Perl 6 is a different story though.
- RandalSchwartz 2y agoI believe Perl got Unicode to a usable state long before Ruby. Ironic, given Ruby's origins.
- deleted 2y ago[deleted]
- stakhanov 2y agoIt's not a race. Perl got there fast by basically not giving a damn about anything. Perl (talking about Perl 5, don't know anything about Raku, don't want to know anything about Raku) simply treats strings as sequences of numbers without requiring numbers to be in the 8-bit range. This makes it easy to say that those numbers could in principle be Unicode codepoints. The problem is that the actual assumptions about what those numbers represent are implicit in programmers' minds, and not explicit in the language, much less enforced in any way. The assumptions shift as strings are passed between different libraries, and sometimes different programmers working on the same codebases have different ideas. Perl will happily do things like encode an already-encoded string, or decode an already-decoded string, or concatenate an encoded string with an unencoded string, or reverse a utf-8 string by reversing the encoded byte sequence, etc. etc. So it's easier in Perl than in any other language I've ever used to end up with byte salad. It'll take you, let's say, the first few years of your Perl career, involving painstaking testing of everything you do with nontrivial characters, to truly grok all of that. But the problem is: You're not alone in the world. If you work on a nontrivially-sized project in the real world that heavily utilizes Perl, then byte-salad will be what you will get as input. And byte-salad will be what you will produce as output. It is frustrating as hell. Unicode was a pretty painful matter in the transition from Python 2 to Python 3, but Python's approach means that the Python ecosystem is now pretty usable with Unicode. This is not the case with Perl at all.
- jjav 2y ago> You really have a mad productivity work horse. I'm not aware of anything that can be as effective at text processing as perl. While I don't do much perl anymore, if I have to wrangle text files in all kinds of ways, there is no comparison, perl rules.
- BiteCode_dev 2y agoYou don't need to learn it now anymore. LLM do Perl well enough, and since 90% of productivity with Perl is earned through small snippets or one-liners (anything bigger is better served with uv init --script), you can just ask the bit you want when you need it. You can even ask the AI to explain the hieroglyphs. Same with bash, awk or powershell.
- creer 2y agoKeep Higher Order Perl for later. It's great but far too much for a 2nd book when getting started. The camel book Programming Perl is still a great start which adheres to the layered aspect. Don't read all of it, just a few parts as needed. I recommend to add Perl Cookbook early, to look things up as you go - it gives idiomatic-ish ideas of how you might do X in Perl. Perl comes with a mountain of very complete and useful man pages: you start with looking things up in the camel book, then transition to looking them up in the man pages.