20 ms·
Perl, the first postmodern computer language (1999)
- tokai 4y agoThe author misunderstood what postmodern is. It is not the next epoch after modernism.
- cestith 4y agohttps://www.wordnik.com/words/postmodern https://www.wordnik.com/words/postmodern Postmodern in this instance means rejecting modernism by remixing eclectic elements from various periods.
- anthk 4y agoSaying that to a lingüist it's... interesting. On Perl, CPAN was and it's still amazing, and lots of stuff came from that. For example, Mojolicious for the web, BioPerl for bioinformatics and Rivescript to write silly chatbots, among others. Oh, and pkg_* under OpenBSD. INB4 gen-z's rant on "PeRl It'S UnRead@ble", check the intro from "perldoc perlintro". EDIT: Unless I'm sure the deleted link it's right, I'd avoid posting it.
- cestith 4y agoPlease don't post links to pirated content.
- anthk 4y agoI think Orelly themselves put these for free back in the day in its own domain. I have to seek archive.org in order to be sure. I tought that because most of the books are outdated (15 years on IT it's an epoch), albeit the sed/awk/perl/*sh and Sendmail books are still godly useful.
- cestith 4y agoI actually received a free book from O'Reilly once for pointing out the exact site you mentioned, so their lawyers could address it. If you want these books very cheaply, the Perl CD Bookshelf usually sells for about $5 used. You get Perl in a Nutshell in print and a bunch of the other books on CD. A better introduction to Perl these days is Modern Perl, which is available to read online for free or you can pay for a print book. http://modernperlbooks.com/ http://modernperlbooks.com/
- collyw 4y agoStop pushing your own moral values onto others.
- cestith 4y agoI don't know about you, but many of us on HN make our livings with things protected by copyright, trademark, and sometimes patents. Supporting the framework that enables our livelihoods is not a moral judgment. It is a practical concern. Also, there are legal issues over promotion of pirated content. Also, there are ethical concerns over pirating content that is easily and cheaply available legally. Also, I said "Please" and didn't force anything on anyone. Also, under a strict interpretation posting directly to pirated material is likely a violation of the Terms of Use for HN. https://www.ycombinator.com/legal/#tou https://www.ycombinator.com/legal/#tou
- collyw 4y agoI said stop pushing, not stop forcing. And I didn't post pirated material I asked you to stop moralizing.
- fps_doug 4y agoI'm more than two decades away from being gen-z, and I still agree with that sentiment. There might be that theoretical wise and disciplined Perl programmer writing well structured and readable code, but wherever I interfaced with people writing/maintaining Perl code, it was the most hastily thrown together crap that once was a small tool that "just worked" and then slowly grew completely out of hands over the years. You can have that in any language, but for some reason Perl always excelled at that discipline. Also, https://www.youtube.com/watch?v=0jK0ytvjv-E https://www.youtube.com/watch?v=0jK0ytvjv-E
- chasd00 4y agoiirc Perl was always described as the "duct tape of the internet" which encompasses the good and bad sides of Perl.
- collyw 4y agohttps://xkcd.com/224/ https://xkcd.com/224/
- the_only_law 4y ago> I'm more than two decades away from being gen-z, and I still agree with that sentiment. Can’t really be a comment without a aside-from-the-point slurring
- cestith 4y agoBe sure to blame the saw and the hammer, as it can't be the fault of the carpenter.
- doomvox 4y ago"... but wherever I interfaced with people writing/maintaining Perl code, it was the most hastily thrown together crap" The badly written stuff needs more "maintenance", and the people who need to work on it are more likely to complain (and I think you're stuck on confirmation bias). In the late-90s, the early web gold rush was on, and a lot of amateurs started writing perl in a hurry as their first language. The fact that they could do anything at all is actually pretty amazing, and I'd say that's a point in perl's favor.
- deleted 4y ago[deleted]
- collyw 4y agoI am pretty sure that the human genome project was more responsible for BioPerl than CPAN was.
- leoc 4y agoReposting my old comment https://news.ycombinator.com/item?id=10774245 https://news.ycombinator.com/item?id=10774245 : > People seem to have forgotten that when Perl evolved from being a better AWK to the paradigm example of the modern "scripting language", Larry Wall explicitly described this as a rejection of the Unix small-tools philosophy. http://www.linux-mag.com/id/322/ http://www.linux-mag.com/id/322/ ("But Perl was actually much more countercultural than you might think. It was intended to subvert the Unix philosophy. More specifically, it was intended to subvert that part of Unix philosophy that said that every tool should do only one thing and do that one thing well.") http://www.wall.org/~larry/pm.html http://www.wall.org/~larry/pm.html The fact that getting things done with a Perlesque scripting language is now seen as the height of purist Unix propriety only shows how far gone the original Unix ideal now is. But moving to the scripting-glue model doesn't really get rid of small tools that endeavour to do one thing well, it just reimplements them inside the scripting-language universe as functions/objects, though with a more expressive and less burdensome common language that makes it easier for them to stay small while being correct and effective. The more expressive their shared language, the smaller [the individual tools in] a set of tools can be. >> Text just isn't a great medium for IPC. > Yes, in retrospect Unix's determination to know about nothing but binary or plaintext blobs and streams looks like an adolescent rebellion against the (apparently - I haven't used them) clunky record structures of '60s operating systems. [Extra text] added for clarification.
- nmfisher 4y agoInteresting take, but as someone who still works regularly with the shell, I'd say there is still a place for small core utils connected together with pipes/textual streams. If we're talking parsing and chopping up text files, I can usually whip up something with awk/jq/cut/whatever in far less time than writing an equivalent Python script. There's a threshold where you prefer to switch to the scripting language for maintainability/testing, but the shell won't be going anywhere any time soon.
- peelle 4y agoI agree with this threshold idea, and I would argue that Perl and probably Ruby also have a lower threshold for switching than Python. Nothing against Python.
- snorkel 4y agoPerl rose to popularity because early web development was all about text processing (reading web forms and outputting HTML) and Perl made that easier (regex deluxe) than other choices on unix at the time. It became the lingua franca of web developers. Perl 5 made heavy use of symbols so it was visually noisy, and then Perl 6 came along and added even more magic meanings to other symbols, and that was a tipping point of perl’s decline. Readability of code is paramount. Code is for machines to execute and for humans to understand. Perl code became both modernist abstract art, and Baroque in its intricacies.
- anthk 4y agoWhat? Perl it's far more than a regex machine looking like line noise. If you think that about Perl, you'll get mad with AWK. To me Perl it's a better tool for anything better than shell scripting without needing to get dirty with C or Go.
- tootie 4y agoAs someone who spent many years loving Perl, I counter that literally every programming language is obtuse and overloaded with meaningless symbols. And I'd also credit Perl's rise to Lincoln Stein who wrote CGI.pm which was at the time the absolute state of the art for managing web applications with Apache and mod_cgi.
- mistrial9 4y agoyes and, one of Perl's design goals was literally "report generation" .. which it turns out, might be in HTML format
- hedora 4y agoIt can't do reports. It's a rubbish lister. It's also clearly not an anagram of REPL. I wonder if anyone ever figured out how to write REPL with a keyboard. I'd like to learn it some day. (REPL was written in a crazy character set and relied on custom printed punch cards. I think it was the perl of its day.)
- 4y ago
- simonh 4y agoI looked up postmodernism. >opposition to epistemic certainty and the stability of meaning Yep, that's Perl.
- rurban 4y agoBut don't forget the anti-movement "Modern Perl". > Minimalism describes movements in various forms of art and design, especially visual art and music, wherein artists intend to expose the essence or identity of a subject through eliminating all nonessential forms, features, or concepts. Minimalism is any design or style wherein the simplest and fewest elements are used to create the maximum effect. - wikipedia on Modernism
- dc-programmer 4y agoMeta-modernism was a mistake
- doomvox 4y agoMaybe you're thinking of slashdot.
- dc-programmer 4y agoThis was a low effort comment on my part. I was mostly lamenting the end of the postmodern aesthetic, which gave us artifacts like Perl. Now we have meta-modernism, giving us the cultural current of affinity to coercion
- kerblang 4y agoFor years Mr Wall attempted to justify Perl as the manifestation of 90's neohippie culture, as this mashup of weirdness that was cool because it didn't worry about being particularly consistent with itself. I think the worst of it is when he draws parallels with the Dave Matthews Band. Ugh. Nothing screams "I'm soooo dated" like fixating on short-lived youth trends. Perhaps he should've described Perl as "hip hop" but... hmmm...
- andai 4y ago>Whatever the verb you choose, I've done it over the course of the years from C, sh, csh, grep, sed, awk, Fortran, COBOL, PL/I, BASIC-PLUS, SNOBOL, Lisp, Ada, C++, and Python. To name a few. To the extent that Perl rules rather than sucks, it's because the various features of these languages ruled rather than sucked. "I have stolen ideas from every book I have ever read. My principle in researching a novel is 'Read like a butterfly, write like a bee', and if this story contains any honey, it is entirely because of the quality of the nectar I found in the work of better writers." Philip Pullman
- cosmiccatnap 4y agoA developer has a problem they cannot solve and so they decide to use perl. The developer now has two problems.
- daneel_w 4y agoIn my experience, Larry Wall's old comment holds true: Perl makes easy things easy, and hard things possible.
- mistrial9 4y agohah - "peak idiom" for that was when Mr Marketing and Sales from Hawaii, Guy Kawasaki, said that on stage to a bunch of developers. I heard it. It was because the Marketing and Sales-turned "software leaders" couldn't read a regex.
- giraffe_lady 4y agoI write regex all the time and I can't read a regex. It's a powerful tool and that's a very valid complaint about it.
- mistrial9 4y agoif my companion says "I am cold" on a warm day in the shade, then it is a valid complaint, since they probably do feel cold. You express empathy for the readers with "valid complaint" and from an educational, empathy point of view, sure, agree. Are regex's used by more people, or less people, than in 1999? Do people read, write and use them in code? for editing HTML pages? of course it is trivially true. That guy was saying to software developers "don't use regex it is a problem not a solution" .. I was there!
- tomc1985 4y agoPart of the fun of regex is learning to make sense of what looks like black magic I imagine asm programmers feel the same way fwiw I think this world needs less "it's too hard for me" and more "let me roll up my sleeves and dig into this"
- newaccount2021 4y ago
- MichaelMoser123 4y agomaybe perl code is a bit unreadable at times, but its documentation is very readable. Just look at: https://perldoc.perl.org/perlfunc#Perl-Functions-by-Category https://perldoc.perl.org/perlfunc#Perl-Functions-by-Category All the standard library ordered as links, by categories that actually make sense! Also perl5 used to be very accessible, even the parser error message made actual sense. I think that a lot of care has been put into these details, and that this attention to details did have a role in the success of the language.
- forgotmypw17 4y agoI love Perl. I use almost none of its more esoteric features, and just write "classic procedural" code, mostly using command-line utilities instead of third-party modules for anything I don't want to write myself (mainly cryptography), and I am so fucking happy not having to deal with breaking changes in my language, a rare quality these days. I used a machine with a 9-year-old distro on it for a few months, and all my scripts ran without issue, and I have high confidence that they will continue to run for years down the road without my having to adjust them for breaking changes in the language runtime, which is more than I can say for most other stacks I've used. Furthermore, ALL the code examples I can google up will work without me having to check if they're for the right version of Perl, because it has near-perfect backwards compatibility going back all the way to 5.000 from 1994. About the only other thing with a comparable level of stability has been HTML/JS/CSS, which gets a lot of new features all the time, but, for the most part, if I use only minimal features, remains usable for years without modification.
- taeric 4y agoTeX has stability to compare. But, stability is seen as a goal for that project.
- giraffe_lady 4y agoI don't know if its backwards compatibility reaches into the 90s but I've been using ruby for this for like a decade now. Most envs that ship with anything ship with ruby and I've only very rarely run into version problems. I think people tend to associate it only with a certain era of web dev, but it has remained a good scripting language with a large, consistent, well-documented standard library for a long time now. Not worth switching off perl since you're very used to that, but iirc ruby was initially conceived as a successor to perl and for me at least it has landed in that role.
- forgotmypw17 4y agoRuby is great, and I know people who swear by it, but I've yet to come across a GNU/Linux distro which didn't come with Perl installed, while Ruby is not a given in the default, e.g. my current Manjaro. The compatibility really does stretch back all the way to '94.
- mproud 4y agoPerl is the sexiest programming language because “there’s more than one way to do it.”
- Aperocky 4y agoJust reading this sentence give me horrors.
- kergonath 4y agoIt’s a blessing because once you are comfortable with a Perl dialect, writing code is very efficient and fun. Perl is very expressive and can also be very concise. It’s a curse, because reading other people’s dialects can be quite difficult.
- Aperocky 4y ago> reading other people’s dialects can be quite difficult. That is why we send any code that cannot be read by a fresh CS grad back for rework. It turns out you can solve everything with very basic and straightforward syntax. But then we also don't use perl.
- jerf 4y agoBy the time I was done writing Perl, my Perl looked a lot like Python. It's also why I'm not really all that sympathetic to "but $NEWLANG doesn't let me write something that extracts from a hash and then map all the elements with an inline anonymous function, filter the results, and then invoke them all and put the results in a single array all in one line!". I worked for decades, plural, in languages that did permit that, and what I learned is that the more professional the code gets, the less you should be doing that. By the time you've broken it out in a way that won't confuse everyone, giving all the intermediate values professional-quality names and adding a few comments, it turns out the delta between Perl and things like Java or Go or other such "stodgy" languages has closed a lot. Not 100%, by any means, but closer, and in the meantime those stodgier languages have been steadily closing the gap from their end too. In the meantime I get a lot of value from the static guarantees those languages have.
- catchclose8919 4y ago...to this day, I still can't wrap my head on how PHP even got to exist in a world where Perl was already filling the web niche just fine. Also, if they wouldn't have made it too-weird-for-math-and-physics people, Perl would've probably filled Python's niche too. And with that kind of resources focused on it, Perl 6 could've actually turned up into a clean nice new language that would've unified us all by also supporting nice compile-to-wasm. </alternative-reality>
- deleted 4y ago[deleted]
- tombert 4y agoI'm speaking completely out of my ass here, but my suspicion for why PHP took over the web is largely because it was "web-first". It was free, open source, and you wrote directly on HTML pages, instead of Perl spitting out HTML via CGI. I think ColdFusion was briefly popular for the same reason (though I think that one fell out of favor largely because it cost a ton of money).
- 0xbadcafebee 4y agoPeople see a tool designed for one specific purpose, assume that must be the best tool for the job, adopt it, then more people do, then it gets popular, then people adopt it just because it's popular.
- Arathorn 4y agoIt's easy; PHP is/was: <html><body> <?php echo 'Hello World'; ?> </body></html> Whilst the equivalent Perl at the time would be: #!/usr/local/bin/perl print "Content-Type: text/html\r\n\r\n"; print "<html><body>"; print "Hello world"; print "</body></html>"; or possibly... #!/usr/local/bin/perl use strict; use warnings; use CGI; my $q = CGI->new; print $q->header('text/html'); print $q->start_html(); print "Hello world"; print $q->end_html(); ...if you were being a bit more more fancy. In other words, there was no standard templating; Template Toolkit eventually became a relatively defacto standard, but PHP had already won - and even then, TT had to be manually invoked rather than just going and freestyling <?php> tags everywhere in your HTML and "it just working". In every other respect Perl is & was superior to PHP, and it's really sad to see Perl fade, despite (or because of?) its crazy flexibility and power.
- lvl102 4y agoI wrote my first web scraper in Perl. It was a great experience. I miss the community mostly.
- deleted 4y ago[deleted]
- 40acres 4y agoThe first code base I worked on professionally was Perl. While I admire it's power I never got used to it. It was very difficult for me to read and our code base was pretty large and I didn't feel like Perl handled OOP well at all. When we switched to Python it was like a breath of fresh air.
- jkh1 4y agoPerl was the first language I used professionally and I used it almost exclusively for years. I don't understand all the negative comments about its use of sigils, I find them useful and I never got the impression that they made the code less readable but maybe that's because I was never taught the gospel of computer science :) I also appreciate the extended backwards compatibility. I still occasionally run decade-old code and it's still doing its job which means that writing code in perl was time well invested.
- tenebrisalietum 4y agoHere's one reason why sigils could be considered to suck. `@array` - array of values. `$array[1]` - get element 1 of the array. `$array` - What do you think this does? Why can't we just `@array[1]`?
- hedora 4y agoThe last one produces a helpful error message at script interpretation time. @array[1] is probably also an error, or you're doing something very strange / wrong, and it'll stick out like a sore thumb during code reviews.
- csdvrx 4y ago> `$array` - What do you think this does? I think it will throw an error if you declared my @array > Why can't we just `@array[1]`? Because that could return an array or a hash if you are dealing with structures likes arrays-of-arrays (AoA) or arrays-of-hashes (AoH). To my naive take, it makes much more sense to only identify high level objects to put them under one category (arrays, AoA, AoH -> @) then consider everything else as "uncertain" and default to $. Otherwise, you would have to declare AoA and AoH differently (ex: my @@AoA; my @%AoH;) and then the interpreter could see @AoA[1] and %AoH[1] as valid but %AoA[1] and @AoH[1] as invalid. I could see that as potentially having value to know at a glance what you are dealing with, but it might break many things, and casting to a new object with my %aoh_1 = %{ $AoH[1] } makes more sense.
- deleted 4y ago
- deleted 4y ago[deleted]
- hzhou321 4y agoPerl is really cursed by the past glory. People still trying to revive Perl against modern fad, for example, Python. Fad are powered by steam of live Eco-systems, which Perl once had, but no longer have. There is no real reason why Perl couldn't succeed where Python does other than the path of history. And there is no real reason to chase history today. Rather than looking for killer app or adding modern features, such as the effort of Perl 6, now Raku, Perl should shed features and focus on stability (which it is fighting hard to retain), on ubiquity (which it had and are losing ground), and core performance (which it is slowly degrading due to features). I think it should try to get a core set into POSIX standard. The core Perl can be like POSIX shell, while a distribution always can distribute a fancier, but always compatible Perl. Perl should replace shell scripting, period. If there is any reason shell scripts is still preferred, then that should be the TOP focus for Perl steering council to address. It really frustrates me to see people today, me included, are still trying to manage basic software engineering in shell scripts. It really amuses me today to listen to pastors on how to write good shell scripts. It really saddens me today to watch efforts of inventing a better shell for scripting.
- mvhvv 4y agoI sympathise with your desire to replace shell scripts, but I don't see why that replacement should be Perl of all things. Like you said, Python has displaced Perl due to ecosystem support, so why chase history here?
- hzhou321 4y agoPython never succeeded in scripting. Shell still dominates scripting today. Perl is rooted in scripting.
- mvhvv 4y agoWhere do you think Python has failed as a scripting language? I'm not very familiar with Perl, but overall I can't think of any obvious advantages aside from some of the syntactic sugar around invoking shell commands and string matching. I can see stability as a knock against Python, but outside of 2 vs 3 the only breaking changes I've really had to deal with were relatively short term issues with third party libs.
- sigmonsays 4y agoanyone remember scaling servers with POE? Ah the good ol days....
- a4isms 4y agoModernism: "Less is more"—Mies van der Rohe Postmodernism: "Less is a bore"—Robert Venturi ————— Guided by these famous quotes, if I were to call a programming language a "Modernist" language, I'd think of something that prizes elegance. It can't just be a small language, it has to be a small language with a few features powerful enough to actually do more. I would think of languages like Scheme or Smalltalk or C as fitting that label. But not JavaScript or Java or C++. And if I were to call a language "Postmodernist," I'd expect a language to incorporate historical motifs, whimsey/surprise, and arresting/attention-grabbing features. Perl might fit that bill. C++ manages to be "more" without being postmodernist, IMO.
- a4isms 4y agop.s. This is fun. So what constitutes a Brutalist programming language? It should be something that: - Exposes the construction materials - Implies mass and permanence - Is usually institutional, e.g. libraries, government buildings, public housing. Only rarely shopping centres or company head offices (which were usually done in the "International" style when Brutalism was a thing). What fits that bill? How about SQL?
- lifefeed 4y agoAda.
- the_only_law 4y agoCOBOL, ABAP
- pram 4y agoMUMPS
- shadowofneptune 4y agoNot sure MUMPS 'Exposes the construction materials', considering how deeply buried it is in applications like Epic by now. Perhaps I misunderstood what that part meant.
- dmux 4y agoPerl was the first dynamic language I learned after taking most of my college courses in Java. It was an eye opening experience in many regards: ease of standing up a web app via CGI.pm, dynamic dispatch tables using anonymous sub procedures, an OOP system based on "blessed" data structures, access to the symbol table, etc. In the last couple of years I've gotten into learning Common Lisp and it's surprising how many similarities there appear to be. I'm actually kind of surprised that given Perl's ability to change packages in an ad-hoc fashion that some type of live programming system was never developed for it.
- iamalnewkirk 4y agohttp://wiki.c2.com/?WhyHatePerl http://wiki.c2.com/?WhyHatePerl
- jlokier 4y agoPerl is a surprisingly Lisp-like language, due to its very consistent approach to closures and statements-as-expressions. Its approach to references, which are reference-counted and have RAII with predictable destructors, is also very clean. I think most people don't notice that Perl is a cleaner and more consistent language in depth than it appears on the surface. Criticisms of Perl often talk about the sigils and other punctuation characters which appear in normal Perl code, implying that's a big issue, or at least rather old-fashioned. (Although I really like Perl and got to know it intimately, especially the guts of the interpreter, I did feel it would have fared better without the sigils.) That might be a fair criticism by modern standards, but if so, it annoys me that Perl gets singled out for punctuation while other popular languages don't. PHP has sigils everywhere, and many languages have some sigils. Rust has quite a lot of special punctuation syntax that has to be written often. Aside from sigils, Rust code looks to me like it has a similar amount of punctuation-oriented syntax as most of the Perl code I used to write.
- natmaka 4y agoWhen it comes to writing code exploiting a database via SQL (and not needing/liking mappers) the trio Perl, DBI and Perl::Critic seems hard to beat.
- noisy_boy 4y agoI have written many thousands of lines of Perl. It is great for text processing type stuff but I don't want to deal with the boilerplate associated with marshaling errors through a deep stack of functions and stuff just failing with "undefined" blah and "die" everywhere. I resorted to Try::Tiny as a poor man's exception handling setup - either give me proper exceptions or give me pattern matching (Rust's Option/Result combined with ? operator is great in this regard). Also, TIMTOWDI starts to suck in a team where everyone thinks they can be clever about their style (simpler languages like Golang, which I don't really love, tackle this better). Especially when you have an entire application in the range of 100KLOC written in Perl. My next project after that was in Java, which in all seriousness, felt amazing. Just like Perl felt when I discovered it after having to write tons of shell scripts.
- mvhvv 4y agoIt's interesting seeing this conception of post-modernism 20 years down the track. I think the article almost gets at the point, but overshoots and ends up in navel-gazing territory with: "Look at the big picture. Don't focus in on two or three things to the exclusion of other things. Keep everything in context. Don't go out of your way to justify stuff that's obviously cool. Don't ridicule ideas merely because they're not the latest and greatest. Pick your own fashions. Don't let someone else tell you what you should like. 'Tsall good." Post-modernism is not so much about picking-and-choosing and going-your-own-way, but it is about looking at the big picture and keeping everything in context. Importantly it's not about the total rejection of assumption and consistency, but about critically challenging and analysing them. I think a lot of folks unfortunately continue to approach it in this same way, but in 202X we often make the additional mistake of assuming that the "modernism" that "post-modernism" is rebelling against is our contemporary "modern" society. That often gets misrepresented as a rejection of the enlightenment or some other extreme sounding position, but it's much better understood as a challenge of epistemic certainty and an attempt to break down and understand our ideological assumptions.
- hawkeyedan 4y agoJumping in on this late, but I think the haters and some of the lovers miss the point. Perl doesn’t need to be Python. It’s great to be the #20 language.
- eternityforest 4y agoI think this is a pretty great analysis of what's wrong with modernism(Which is unfortunately coming back), the part I disagree with is programmer creativity and "There is more than one way to do it" thinking. The current crop of popular languages does it really well. They aren't designed starting from any kind of simple theoretical construct like stacks or lisps or machine code, but they do always watch your back and prevent many unsafe(Unsafe in the sense that they allow common mistakes that are hard to detect automatically) constructs, while providing equally easy constructs. A lot of the value in moving away from modernist thinking is that you actually have fewer concepts to work with. In programming, the usual goal of minimalism is to let you build exactly what you need. Since you're building it yourself as you go, the language effectively has every imaginable feature, minus any syntactic sugar for any of them. I suppose that's where the idea that all projects eventually include half of common lisp comes from. Perl's rich but predefined set of language and syntax features was a wonderful advancement, but other languages have since combined that with a lot more safety and opinionatedness.