Hacker News new | past | comments | ask | show | jobs | submit login

I wonder, is Perl more ubiquitous than Python for these cases?



It is! Modern macOS, fresh install: no Python, no Ruby, but Perl is there. Git for Windows adds Bash with Perl in it. Every linux server has it. You probably can come up with some Docker image that doesn't have it installed, but it comes in as a dependency to a lot of linux software.

The cool thing is that Perl is compatible, and maintaining compatibility is the top priority for Perl developers. so, many distros keep updating it because it's very safe to do so. When many projects switched from GPL2 to GPL3 macOS famously decided to either freeze some bundled tools, switch to alternatives or removed them entirely. It took them years and years, but all this time Perl has been a notable exception.

As a result nowadays you can be very certain that every machine you run your code on has a very recent Perl installed, so you can use many new stuff, too. It's an old language, but the code you can write can be pretty modern, which is nice.

It's still Perl: lots of symbols, some variables get set up implicitly for you, some keywords look silly to modern eyes (`my` to declare a variable, `sub` declares a function). Some newish stuff is handy. Like, these days you can specify types of parameters in function signatures, and it does a rudimentary type-checking for you. And Perl regexes are still better than in ANY language out there, for 35 years and counting!


> It took them years and years, but all this time Perl has been a notable exception.

If we take Apple at their word then it's an exception only in that they haven't got round to it yet, not that it isn't also going to be culled -- the Catalina release notes mentioned Perl explicitly alongside the other two:

    Scripting language runtimes such as Python, Ruby, and Perl are included in macOS for
    compatibility with legacy software. Future versions of macOS won’t include scripting
    language runtimes by default, ...
-- https://developer.apple.com/documentation/macos-release-note...


Yep, Ruby and Python got removed very quickly from the system following this announcement. Perl, however, stays. It seems like some components of macOS depend on it and the dependency is hard to remove. It will likely happen but huge kudos to Apple for keeping it up to date meanwhile.


I switched from Python to Perl for a lot of these use cases as the Perl across many target devices is gonna be much the same/largely compatible, and virtually always present, while Python could be some random fucking version or broken or not present.


Perl gets installed wherever `git` CLI is available, generally. I'd say it's more ubiquitous. And it doesn't suffer from the python2/3 split.


That split was terrible and it took over a decade to fully resolve, but it's behind us now.


...for those lucky enough to be able to do so. I've been promised the Red Hat Enterprise Linux 3 systems will be replaced in two years. 10 years ago, they were to be replaced in one year.


Neither does Python, for years now.


I'm pretty sure people are going to be haunted by it for years. I just updated some internal scripts for Python 3 this year.

I believe they should have been Py3 when they wrote them. It was not my decision, but it did become my problem.


Perl did have a 5.6/5.8 split over unicode, but it wasn't nearly so bad. By the time 5.10 came out, I think everything had been sorted. Or my work changed and I stopped running into code that I needed to patch 'use bytes' into.


not to mention the perl5 / perl6 split

perl6 is now called raku


Possibly more terse.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: