5 ms·
I'm having to pick up some perl now, and while I don't interact with the community, it surely _feels_ like it was written by wizards, for wizards. Obscure, non-
by pavel_lishin 11mo ago
I'm having to pick up some perl now, and while I don't interact with the community, it surely _feels_ like it was written by wizards, for wizards. Obscure, non-intuitive oneliners, syntax that feels like it was intentionally written to be complicated, and a few other things that feel impossible to understand without reading the docs. (Before everyone jumps on me - yes, as a developer, I should be able to read documentation. And I did. But until I did so, what the code was doing was completely opaque to me. That feels like bad language design.)
Some of it I recognize as being an artefact of the time, when conciseness really mattered. But it's still obnoxious in 2025.
The whole thing reminds me of D&D, which is full of classes & spells that only exist in modern D&D because of One Guy who happened to be at the table with Gygax, who really wanted to be a wuxia guy he saw in a movie, or because he really wanted a spell to be applicable for that one night at the table, and now it's hard-coded into the game.
- phil21 11mo agoIt’s interesting to me how brains work. Perl has always “flowed” for me and made mostly intuitive sense. Every other language I’ve had to hack on to get something done is a struggle for me to fit into some rigid-feeling mental box. I understand I’m the weird one, but man I miss Perl being an acceptable language to pound out a quick program in between “bash script” and “real developer”.
- pavel_lishin 11mo agoWas Perl one of your first languages by any chance? I freely admit that I've only been poking at it for a few months; maybe by this time next year, I'll be boggled at the comment I left, like it was written by a different person. > in between “bash script” and “real developer”. One of my coworkers gave me some great perspective by saying, "at least it's not written in Bash!"
- phil21 11mo agoYep, first language I learned. And since I was somewhat early to the Internet thing, I found IRC when I was about 14 years old and actually learned from a lot of the folks who have authored books on Perl or are at least (were) well known in the community. It certainly was the major factor in how I connected the dots! Haven’t really thought about it until now, but I suppose having Larry Wall and Randal Schwartz telling you to RTFM guides your early development in a certain manner. I certainly have never considered myself a developer or programmer though. I can pick up enough syntax to get a quick hack done or start a MVP to demo my ideas, but I leave the “big boy” dev stuff to the professionals who can run circles around me.
- alsetmusic 11mo agoNot the person you replied to, but I thought the same thing. Perl was my first as well, and it certainly shaped the way I think about coding. It made Python feel too rigid and Ruby feel familiar. There's something to be said for the restrictions of an environment when you're learning how to operate in a domain that seems to shape future thinking. I'm sure there are people who started in a language and later found something that made more sense. I'm just reflecting on what I've found in my experience.
- AndrewDavis 11mo ago> There's something to be said for the restrictions of an environment when you're learning how to operate in a domain that seems to shape future thinking. When at University the academic running the programming language course was adamant the Sapir–Whorf hypothesis applied to programming language. ie language influences the way you think.
- alsetmusic 11mo agoI only recently learned about this, maybe a month ago. It made a lot of sense to me.
- algernonramone 11mo agoSeems somewhat related to Iverson's 1979 Turing Award lecture, "Notation as a Tool of Thought" (https://www.eecg.utoronto.ca/~jzhu/csc326/readings/iverson.pdf https://www.eecg.utoronto.ca/~jzhu/csc326/readings/iverson.p...)(https://news.ycombinator.com/item?id=25249563 https://news.ycombinator.com/item?id=25249563)
- asa400 11mo ago> One of my coworkers gave me some great perspective by saying, "at least it's not written in Bash!" I wish bash was the thing that was dying. As an industry, we need to make better choices.
- skywhopper 11mo agoThere’s nothing that can replace bash for what it does. People have been trying for decades. You’ll be happier if you accept that bash can and will happily coexist with anything and everything else, which is exactly why it will never go away.
- skydhash 11mo agoCLI usage revolves around text and bash is a meta layer above that. Given curl, jq, and awk, you can create a quick MVP client for almost any api. Doing the same in Python and Go is much more involved.
- QuadmasterXLII 11mo agoThrow in nc and a while loop, and you can have a server too!
- keernan 11mo ago>it will never go away Chet Ramey became the primary maintainer of Bash in the early 1990s and is the sole author of every bash update (and Readline) since then. That would be an enormous task for a team of 100, no less a team of one. I've become quite a fan (after struggling mightily with its seemingly millions of quirks.
- BobbyTables2 11mo agoIndeed. If I had to download and install bash … I wouldn’t! I write bash scripts only because I can rely on it being there.
- em-bee 11mo agoi think this is changing. in recent years, alternative shells that break with bash syntax like fish or elvish and others are gaining in popularity. oils is of particular interest because it has an sh/bash compatible mode and thus provides an upgrade path away from bash.
- MayeulC 11mo agoAt least you have bash scripts. Most of my coworkers write tcsh scripts :| (And yes, I have been pushing for bash or posix sh).
- SoftTalker 11mo agoI think if you were a sysadmin and used to shell scripts, sed, awk, grep and xargs then perl probably made more sense than if you were a programmer from a more traditional language coming into the perl world.
- aorloff 11mo agoIf I am familiar with sed, awk, grep and xargs, was I a sysadmin ?
- tsimionescu 11mo agoIf you are familiar with all of these but not C or Java or some other "traditional" programming language, then yes, I think anyone would guess you were a sysadmin. This was the type of background GP was talking about - people familiar with shell scripting but not any other programming language, who come by Perl for the first time.
- Suppafly 11mo ago>I think if you were a sysadmin and used to shell scripts, sed, awk, grep and xargs then perl probably made more sense than if you were a programmer from a more traditional language coming into the perl world. This, it was very unixy and felt like a natural progression from shell scripting. I think that's why a lot of early linux adopters were so enamored.
- npsomaratna 11mo agoThat makes a lot of sense. After 30+ years of programming, I still have to do a search (or use an LLM) to do anything useful with sed, xargs, etc. Perl never really clicked with me either. On the other hand, I was able to easily pick up just about any "tradional" language I tried--from Basic and C in the 80s all the way to Dart and Go more recently.
- pjmlp 11mo agoAs somone that switches between both roles, when doing DevOps (aka sysadmin in 21st century) even though there is more stress regarding dealing with infrastructure, there is a certain peace of mind being away from Scrum, Jira, milestones, and other stuff, versus plain shell scripts, sed, awk, grep and xargs, VMs up and down. Or doing a plain set of scripts into a repo, instead of endless arguments how fit a module implemenents the onion and hexagonal architectures, clean code, or whatever is the trend in this year's architecture conferences.
- chamomeal 11mo agoIf you’re in the market for fun hackable tool that sits between “bash script” and “real developer” I highly recommend checking out babashka. It lets you write shell scripts with clojure. Babashka itself is a single executable, so no JVM bulk or startup time. And the built-in libs include all sorts of nifty utilities. Parsers, servers, excellent async stuff (but IMO clojure might have the best async story of any language out there so I’m biased), http stuff. All macro-able and REPL-able and everything. It’s a scripting dream, and when it’s time to be an adult, you can throw it on the JVM too!
- erpellan 11mo agoYou might also enjoy Janet https://janet-lang.org/ https://janet-lang.org/
- chamomeal 11mo agoWow that IS cool!! Almost sounds too good to be true lol. Green threads? Repl? Event loop? One <1MB binary? What the heck!!
- zenlot 11mo ago[dead]
- em-bee 11mo agoa different approach is to replace bash altogether and switch to modern shells like fish, elvish, murex, nushell (not stable yet afaik) or oils (very interesting approach, it has a bash or sh compatible mode and another one with a more modern and cleaner syntax).
- signal11 11mo agoI agree. Perl made sense as a “step up” in the world of *sh and awk. Also the culture wasn’t hostile to me as a newcomer. The Perl books I read encouraged not writing overly terse, cryptic code, and I got helpful answers via mailing lists. I still use Perl sometimes if my command pipeline gets too complicated.
- dxdm 11mo agoIt's been a while, but I found for me personally, that Perl flows while writing it, but stops flowing when reading the same code after some time has passed. It was good for getting things done once, but no fun to maintain and adapt - at least the way I was using it decades ago. I moved from Perl to Python and never looked back.
- klipt 11mo agoLUKE: Is Perl better than Python? YODA: No... no... no. Quicker, easier, more seductive. LUKE: But how will I know why Python is better than Perl? YODA: You will know. When your code you try to read six months from now. https://wiki.python.org/moin/PythonCdFun https://wiki.python.org/moin/PythonCdFun
- tootie 11mo agoI wrote a ton of Perl 5 and also found it very intuitive and powerful. I think the notion that Python is "more readable" is true, but also less useful of a metric than it would seem. Python is still gibberish to a new coder and requires training and experience to master. Perl requires somewhat more effort to acclimate to, but ultimately is much more expressive and much closer to real-world software engineering problems. Once the incremental effort is made, Perl is (or at least was) a better Python.
- jgalt212 11mo agoFor me it's not so much that Python was more "readable" than Perl. I've found pretty much any language other than XSLT more readable than Perl.
- altairprime 11mo ago> Some of it I recognize as being an artefact of the time, when conciseness really mattered It was an artefact of bursting out of those constraints, but honoring them still. The roots of perl as a “more capable, less restrictive” sed/awk means that it must support `perl -pi.bak -e oneliner file`, just like sed did — and so from that core requirement forward, everything it did, does. By the heyday of Perl5 era, conciseness was not a requirement, but the sed-compat roots remained a focus of the language’s creator.
- petre 11mo agoYup, Perl is something clearly out of Unseen University, err I mean Berkeley linguistics dept. I liked it, thought the sigils were a cute way to singal that something is a variable. When you work with deeply nested data structures, dereferencing arrays and hashes that sort of changes and becomes kind of annoying. Nowadays I like Ruby. Compared to it, Perl does feel like spells mixed with C and Posix stuff. But if I want to feel smart, I'll write some code in Scheme, thank you.
- tasty_freeze 11mo agoIt isn't bad language design that you need to study the language before you can use it. I look at haskell programs and it looks mysterious to me because I haven't spent any time studying it, but I'd not thing to say it is bad language design. Yes, one can write obscure perl code and some love perl golfing. In the same way there is an IOCCC which delights in unreadable code, it doesn't mean that the C language should be relegated to the dustbin. The answer is to write readable code, no matter which language is in use.
- harpiaharpyja 11mo agoSeems like the essential criteria is not whether you can write opaque code in it, but rather whether the language enables you to accomplish most tasks using clear, readable code. They aren't mutually exclusive. Hopefully I am paraphrasing you correctly.
- pavel_lishin 11mo agoBut I can look at most Python code and be able to understand what it does. With perl, I have to look up so much. - Why is there a `1;` on a single line in the middle of this file? - What is `$_`? - This parallel execution manager doesn't actually seem to define what code needs to run in parallel in any specific way, how does this work? - What is this BEGIN block at the start of this Perl file? Why is that necessary? - What's going on with qx, qw, qq? - What does chomp do when it's just on its own line, with no arguments given to it?
- tasty_freeze 11mo agoAgain: python syntax is more akin to what you are used to, and so it feels more comfortable to you. $_ is inscrutable if you haven't studied perl, but the same thing would happen to anyone who sees a python decorator for the first time. what does "else: do after a while loop in python? Only people who know python know what it does (and I suspect most don't). The different quoting operators are also trivial to learn. In comparison, yield from python is also simple syntax but the semantics are much more involved. BEGIN? Take 60 seconds to read what it means. And if you knew awk, you'd not have to do that, as it was directly lifted from awk.
- lo_zamoyski 11mo agoThe term "surrogate activity" comes to mind, specifically, activities of no real value that some people like to waste time on to feel better about themselves.
- __patchbit__ 11mo agoPeople summit Qomolangma. (with logistics)
- kamaal 11mo ago>>I'm having to pick up some perl now, and while I don't interact with the community, it surely _feels_ like it was written by wizards, for wizards. Those days were different. You could say what people are doing in months to years today, in many ways people back then were doing in days to weeks. Pace and ambition of shipping has not only faded, that very culture is non existent. You don't see people building the next Facebook or Amazon these days, do you? I remember managers asking Java programmers how much time it would take to get something done, and get timelines on months and years. They would come to us Perl programmers and get it done in a week. The era didn't last long. I would joke around our team saying, ideally a Java programmer with 10 years experience was somewhat like like a Perl programmer with 1 year experience. This was one of the big reasons, most of these enterprise coders wanted Perl gone.
- colinstrickland 11mo ago> Pace and ambition of shipping has not only faded, that very culture is non existent. You don't see people building the next Facebook or Amazon these days, do you? Do you not? The pace of anthropic/Claude tool development is pretty bonkers, AI hype reminds me of the 90s a lot.
- petit_robert 11mo ago>This was one of the big reasons, most of these enterprise coders wanted Perl gone I see some people disagree with you, but reading this reminds me of this anecdote : My brother has a very high IQ score, but poor social skills. He once found employment in one of the very early companies developing websites in our area. There was a process requiring to manually check hundreds of links for validity, which took large amounts of time to do (as in several developper hours weekly), and was error prone at that. The details are fuzzy as this happened some 30 years ago or so, but essentially he found a logical way to do the thing without error in 15 minutes. The other developers went on a rampage to dismiss the solution, for fear of looking like idiots, and even though the solution was provable, my bro go fired, and went on to become a mechanic. What a shame though. So, your comment rang a bell. Also : I make a living developing and maintaining a handful of custom made SaaS for small clients on a LAMP stack (Linux Apache Mod_perl Postgresql). Very thrifty. Little money, but loads of fun as far as I'm concerned
- pasc1878 11mo agoThis is it. I wrote largish systems in perl using its OO things and that was good. The one thing I could never ever get was using a regex - not the regex itself but the line to actually use it. Python was so much easier as it was simple define the regex and then use a function on it. I suppose I should hjave spent a few days to write some wrapper in perl - doing those few days would have saved me time overall. As for one liners I was originally an APL programmer so not a problem. But it is just bad style to write a one liner much better to write it in a maintainable form and split up the operations so they can be seen. Nowadays I ddon't use lambdas if possible - much better to have a named function you can refer to.
- finaard 11mo ago> Python was so much easier as it was simple define the regex and then use a function on it. I suppose I should hjave spent a few days to write some wrapper in perl - doing those few days would have saved me time overall. That's funny. I avoid python whenever possible, but one of the things I hate the most is how it is doing regex. I find the way it works in perl (both for search/replace and in conditionals) just intuitive.
- 59nadir 11mo ago> I'm having to pick up some perl now, and while I don't interact with the community, it surely _feels_ like it was written by wizards, for wizards. Obscure, non-intuitive oneliners, syntax that feels like it was intentionally written to be complicated, and a few other things that feel impossible to understand without reading the docs. Perl 5 is to me a classic scripting language (as opposed to an actual programming language), for both good and bad. I've always viewed Perl scripts with exactly that perspective and I find them fine/good. In contrast, I find Python to be a mediocre scripting language, an okay-ish programming language from a syntax perspective and a bottom-5 programming language in pretty much every other regard.
- tonetheman 11mo ago[dead]
- busfahrer 11mo agoWhile I'm not a fan of Perl per se, I find it fascinating. One of the reasons for that is that its creator, Larry Wall, is a linguist by trade. This shows in a lot of ways, for example by the fact that, like natural languages, Perl has context: A variable can behave differently whether it is used in a scalar context or an array context. At the same time stuff like this is responsible for Perl's reputation as a write-only language, a cliche which has at least some merit to it. I can highly recommend reading at least the first chapter of Programming Perl, it's highly insightful even if you don't plan to write or read any Perl.