Live data from Hacker News

Perl, the first postmodern computer language (1999)

wall.org

171–180 of 225 posts

Re: Perl, the first postmodern computer language (1999)

#171

...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 suppor…

The reason was shared hosting. Most of the really good Perl options for application building used mod_perl which did not play well in shared hosting environments. If you could find a host, you were still somewhat at their mercy for getting modules installed, which was a huge pain in the neck.

Conversely, PHP was trivial to set up for safe shared hosts.

The end result was that Perl hosting was expensive and had a higher barrier to entry than PHP.

Re: Perl, the first postmodern computer language (1999)

#172

...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 suppor…

Perl tended to follow rather than lead which is why it lost to its competitors - first PHP, then Ruby and Python. For example, Ruby had its own server interface - Rack - long before Tatsuhiko Miyagawa developed a version for Perl called the Perl Server Gateway Interface (PSGI) upon which Plack was built but Ruby was off to the races with Rails by then.

Re: Perl, the first postmodern computer language (1999)

#173
I 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.

Re: Perl, the first postmodern computer language (1999)

#174

Earlier quoted context omitted.

That doesn't really capture what's been happening. If feature bundles are still today's plan, it's only because the multiple attempts to get strict on by default have so far all been defeated. They are still pushing forward adding options to disable features like indirect calls, multidimensional hashes, bareword filehandles, etc. And you can bet that at some point they will revive the idea of moving to Perl7/8/9 and…

Well, there's certainly a deprecation cycle in play, and some things may be on their way out that I would rather see kept around (e.g. they seem to have given up on getting the case statement-- given/when-- working: it's tough to do it right without built-in types), but seriously you seem to be behind-the-times on how the project is being managed. If they implement a version 7.0 scheme again, I guarantee they'll do i…

Hopefully you are right about all of this. I don't follow it closely, but when I periodically check in on nntp.perl.org I get the feeling they have no idea what to do about v7 anymore. Since they have to say _something_, currently they say they have no concrete plans but won't change defaults. We will see.

Feature bundles don't bother me, but if I read between the lines (possibly too much), comments they make seem like they are still looking for an opening to remove some of these features entirely. I hope I'm wrong.

(I remember the Ongoing Disaster talk, I personally thought it was fun)

Re: Perl, the first postmodern computer language (1999)

#175
post #59

Perl 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-ol…

Larry Wall said once that he added sigils in Perl so he could freely add features to the language without conflicting with other's peoples variable names. It's a language design choice that makes sense for Perl's maximalism approach to features. Perl is very well thought out, in a way that I don't think gets enough credit. For example, the three loop controls (next, last, redo) are four letters long, which makes reme…

Two of my favorite Perl features:

unless/until can be way more readable in some conditions than if/while.

Postfix conditionals and loops make flatter code, especially in scripts. Love writing "do function() if $condition".

Re: Perl, the first postmodern computer language (1999)

#176
post #66

Earlier quoted context omitted.

One thing I like about the sigils is that they make bad ideas hard to type. Want to pass me a hashtable of lambdas that return arrays of alternating functions and regexps? Go ahead. Show me how to invoke it. I'm waitng. Python (which has all of the type safety and expressivity of perl) allows such abominations to hide behind clean looking syntax. Sigils also improve readability. Bad Perl looks like serial port noise.…

> Bad Python looks like good python. Never used Perl, so I can't really make an honest comparison. I do use Python at work, though, and I can assure you that is FAR from being true. In fact, I think this is so untrue that I urge you to check out essentially any code written in academia (especially projects involving numeric computation and data science). If you come back and make that same statement with a straight f…

I meant superficially. I could write a script that computes histograms over the frequency of the characters in its input, and use the output to judge perl code quality.

In Python, that heuristic wouldn't work nearly as well.

Re: Perl, the first postmodern computer language (1999)

#177
post #66

Earlier quoted context omitted.

One thing I like about the sigils is that they make bad ideas hard to type. Want to pass me a hashtable of lambdas that return arrays of alternating functions and regexps? Go ahead. Show me how to invoke it. I'm waitng. Python (which has all of the type safety and expressivity of perl) allows such abominations to hide behind clean looking syntax. Sigils also improve readability. Bad Perl looks like serial port noise.…

> arrays of alternating functions and regexps many languages will allow you to succinctly express the concept of "the type of this element is a or b" e.g. typescript: https://www.typescriptlang.org/docs/handbook/2/everyday-type... Rust: https://doc.rust-lang.org/book/ch06-01-defining-an-enum.html F# : https://docs.microsoft.com/en-us/dotnet/fsharp/language-refe... IDK, allowing that kind of type to be declared seems…

Sum types are great, but neither perl nor python let you statically check that they're being used properly.

Re: Perl, the first postmodern computer language (1999)

#178
post #3

Reposting my old comment 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/ ("But Perl was actually much more countercultural than you might think. It was intended…

"Not guilty, Your Honor. Perl users build small tools all day long." (L. Wall)

Re: Perl, the first postmodern computer language (1999)

#179

Earlier quoted context omitted.

Curious - is there a reason to use Perl (Wall's latest version, 5 or whatever) in 2022 if one has no familiarity with the language? What would be the major advantage of using Perl over its closest analogues, some bastardization of Bash and Python?

Well, Larry Wall's latest project was called "Perl 6" but has been renamed "Raku"-- in belated recognition that it really is a new language, and Perl is going to continue being Perl. The main reason to learn Raku at present is simply that it's profoundly different from most other things out there-- there's no particular "killer app" that's emerged for it, but it's unusual enough that this might happen yet (no one exp…

Thank you to provide 1, 2, 3 above. I didn't know about these!

I am surprised you didn't mention Perl 11 which is try to mash Perl 5 and 6/Raku together. Is that still happening? Or do I have it wrong?

"How Perl compares to Python": The first thing I tell Perl programmers who are starting to learn Python: There are Perl-style references in Python. (If you are not familiar with Perl: These are a roughly pointers, and can be 'undefined' / null.) In short: You cannot create a reference to a scalar in Python. Perl hackers then scratch their head and ask, "Well then, how do I build XYZ data structure without...?" The easy workaround is a single element tuple or list. "Aha!" Otherwise, Perl programmers can adapt very quickly to Python.

Re: Perl, the first postmodern computer language (1999)

#180

I 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…

Curious - is there a reason to use Perl (Wall's latest version, 5 or whatever) in 2022 if one has no familiarity with the language? What would be the major advantage of using Perl over its closest analogues, some bastardization of Bash and Python?

I don't write any Perl scripts these days, but I still use Perl one-liners frequently at a Bash command prompt and in Bash shell scripts.

Example: Convert Windows newlines to UNIX newlines: $ ... | perl -p -e 's/\r\n/\n/g' | ...

My brain is too full to remember how to do similar regexy transformations using sed, but I know it can be done.

Post reply on HN