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

I'm curious to know if anyone out there building new systems in Perl or is it all just maintenance mode for Perl based systems?



I chose to build in Perl because of its ubiquity and committment to backwards compatibility.

I was extremely frustrated with existing projects having dependency issues and frequent breakage and wanted to avoid that at all costs.

Perl's flexibility has allowed me to develop my own coding style, which is basically Java-like, and I rarely have trouble figuring out what something does, even months later.

I think Perl is vastly underrated as a language, and its suffers from repeat-speak of people who have only seen poorly written Perl or have never seen a well-managed Perl project.

One of my favorite things about Perl is that there are 20 years of code samples on the Web for it and they ALL WORK because Perl has not introduced breaking changes since 5.000.


Unfortunately most of that doesn't really matter for any non-trivial project, because you'll almost unavoidably need a module for something. A lot of the time you'll find out that it's bit rotted 5 years ago, and the bug tracker has a 7 year old issue nobody seems to have read.

It's even worse for anything that interacts with libraries or APIs -- those change over time, and often nobody does the work to repair compatibility.

So I think at this point it's fair to say it's dead. Even if the core language is technically functional, the ecosystem is rotting.


Perl doesn't need an ecosystem any more than the Almquist shell does. It's just a nice tool that's omnipresent on UNIX systems. It's definitely going to be useful for shell scripters for a very long time.


list of perl modules in cpan sorted by last update time

http://www.cpan.org/modules/01modules.mtime.html


My 5 years and counting project diagrees with you.


> because Perl has not introduced breaking changes since 5.000.

I was curious and you made me check. There's a number of releases with incompatible changes listed if you google for it. For example a whole list at https://perldoc.perl.org/5.12.0/perldelta#Other-potentially-... So no, there's been quite a few.


> no, there's been quite a few.

Yes, most of them relatively minor though, which is why the OP has never stumbled across one.

(I found one once-- it turned out one coder had invented his own hash slice syntax. It wasn't supposed to work, but it did, until a particular upgrade...).

In general, Perl has been traditionally committed to backwards compatibility, but not fanatically so-- there is a deprecation cycle that can be used to remove the more problematic things.


Yes, and these changes are feature flagged and optional and would not affect existing scripts.


No, those are "real" breaking changes in that a script running in one version of the interpreter could break if it runs in a later version, without any modifications to the script itself. But in fairness, they're a very conservative definition of breaking changes - e.g. the output of the `--version` flag changing, or some Unicode characters classes changing.


I found Perl suffered from dependency issues as well. Not the language but the modules you tend to want to use. Especially when they're underpinned by c libraries. I'd preference operating system libraries then fall back to Cpan. Over time it got harder to maintain older applications as the libraries dropped out of repositories. Have you found anything similar?


You're right, and this is why I don't use third-party modules. If I need something I can't write myself, I use the shell version instead of a module.


Seems like you're jumping through a like of hoops to write thing in a Java-like fashion when you could be using Java, which has a much healthier ecosystem.


Java has many other shortcomings which keep me from using it.


python also has this problem


Unfortunately, yes, people are still building new systems in Perl. In my experience, it's been because existing infrastructure that new systems need is already written in Perl.

I'll note that if you use a strict subset of Perl, and write it well, with lots of unit tests, it's bearable to use. But it falls massively short when it comes to anything concurrent or async. And if you stray into the "clever" subset of Perl, frankly it becomes hell. The ecosystem is also pretty much dead, it's not unusual to find bugs in packages where the issue tracker hasn't been responded to in 10 years, and the issue for the bug you're interested in has been languishing for literally years.


> The ecosystem is also pretty much dead, it's not unusual to find bugs in packages where the issue tracker hasn't been responded to in 10 years, and the issue for the bug you're interested in has been languishing for literally years.

Yes. Very much this. Anecdotally, I'd estimate that, outside of the big, well-known modules, about 25% of the CPAN modules I try to use have bugs that render them unusable and unresponsive maintainers.

Here's a description of an example I found last year - https://dev.to/davorg/failing-to-get-product-information-fro... (my project to write a replacement module has stalled).


> And if you stray into the "clever" subset of Perl, frankly it becomes hell

Yeah, this is the thing... it's very very easy to go down a one-way street to an endless hell of incomprehensible line-noise code and "clever" tricks that are incomprehensible and unmaintainable.

On the plus side, having dealt with the hell of "clever" perl early in my career (and, ahem, maybe having been guilty of writing some), it has beaten into me the absolute necessity of writing the simplest, clearest, not-clever code possible. In some other language.


> it falls massively short when it comes to anything concurrent or async

Perl has some decent CPAN modules for handling multi-process applications-- it is true that it's very weak for threaded applications.

(Raku on the other hand has some extremly convenient CAP features in general.)


> But it falls massively short when it comes to anything concurrent or async

Nonsense, there's AnyEvent, EV, IO::Async, Mojo::IOLoop. If you need parallelism, yes, you'd better use Go or something else.

And the 10 years old bugs are to a large extent an exageration, because those modules are probably abandoned and you shouldn't use them anyway.


> Nonsense, there's AnyEvent, EV, IO::Async, Mojo::IOLoop

My experience with all of these has been that they've been frustrating to work with, and general support for them in the broader ecosystem is lacking and mutually incompatible.

> those modules are probably abandoned and you shouldn't use them anyway.

Yes, that's the point, the ecosystem is now lacking because of the number of abandoned modules (even for quite common stuff).


Mojo::IOLoop is quite lean and straightforward to work with, but it's quite minimal. If I'd pick something, I'd probably pick this one as the decision to use Mojolicious was very rewarding.

AnyEvent is harder because it uses closures everywhere but it works really nicely otherwise. It's not endorsed by some in the Perl community because the author insists that it doesn't need a license and chooses to develop it and track bugs on his own infrastructure. EV is developed by the same author and it requires a compiler, it can be plugged into AnyEvent. They're both very good quality.

IO::Async is a different event loop brought to you by the people that do not endorse AnyEvent but are involved with Perl 5 development. I haven't used it, but it has a large number of active bugs on RT, plus past criticism from the author of AnyEvent.

There's also POE which we use but it's possibly on life support and you probably wouldn't want to use it unless you want to live in callback hell, so I fully understand your frustration if you've actually tried it. We use POE in a critical part of our infrastructure and has worked fine, but that part is quite frustrating to maintain. Futher criticism of this event framework could be found here:

https://metacpan.org/pod/AnyEvent::Impl::POE

As a sidenote, I'm curreny working with Ruby's Async:IO which is a breath of fresh air compared to other event loops that I've worked with in the past.


Perl is very well suited for certain tasks (not large software systems, but programs that process data). It is also one of very few languages/ecosystems where you can expect your code to work after >10 years. This is why I sometimes use it, for example my fs consistency checker (https://github.com/jwr/ccheck) was written in Perl specifically because it's a long-term tool and I would like to be able to run it on any system in 15 years.

Compare this long-term approach with the fires in Python or (heaven forbid) Node ecosystems, where things break all the time.


"not large software systems, but programs that process data"

I disagree. Perl still works fine for large systems. I understand why people choose other languages. It depends on what your needs are and what skillset works best for you and those you work with.


> because it's a long-term tool and I would like to be able to run it on any system in 15 years

What about Docker and Virtualenv? Both make it possible to keep running code until the end of times.


I've also used Perl for small utility programs (basically as a "enhanced" shell script). The problem with Docker or virtualenvs is that they greatly increase the installation complexity of your script.

For example, two years ago I wrote a small (50 LOC) Perl script to convert between two text format. On Unix you could install it by just putting the one file in /usr/bin. It would run in less than 1 ms, which was critical because it was repeatedly invoked by another (legacy) program. It was mostly a bunch of regex so it was natural to write it in Perl (or awk maybe but I don't know awk).

The python equivalent would have been at least 30x slower, significantly longer, less portable etc. Using docker just for this script would have been overkill. The only real alternative IMO would have been to make a statically compiled Go or Rust binary.


I do use Docker for freezing dumpster fires like CSS toolkits that need to be built using node. And that works well to a certain extent, but there is still the complexity of Docker, having to set it up when you want to use the tool, having to deal with changes happening in it over the years, setting up filesystem sharing, etc.

Whereas with Perl it's easy: any UNIX system (and I do mean UNIX in a wide sense, as I've run perl on systems like HP-UX, Solaris, Unicos, IRIX and others) will normally have perl5 installed and you'll be able to just run your software. If it doesn't have perl5, installing it is usually very easy and you don't have to deal with horrors like the python2->python3 transition.


Also, cpan (better cpanminus) will work well enough.


Speaking as a London-based freelancer specialising in Perl, I can tell you that the number of companies developing new systems in Perl is tiny (like, maybe, half a dozen).

Until four or five years ago, there was still plenty of maintenance work to be had, but even that has pretty much dried up now.


I think Ruby is heading in the same direction.


I'll qualify that by some observations re the Ruby job situation in London which seems quite steady. Rails jobs in London in Indeed, for example have hovered around the 250 mark for many years now whilst Ruby jobs advertised are still higher than Golang. I just received an email from a recruiter listing 21 Ruby roles so it's not quite Perl yet. I also notice a high percentage of "Who Is Hiring" roles here on HN feature Ruby/Rails so maybe Ruby's fate will be as a middle-tier language with adoption just below the big guns - Python, JS, Java, C# and PHP.


Yes, the trend of usage metrics don't look promising. It's basically only used for Rails and the heyday was 2010-2016. People are much more likely to reach for Django/Python or Javascript backends, especially with the ubiquity of React. Ruby jobs are going to generally be maintenance of older projects.



Will take awhile for Ruby to reach that state (if at all), 15 years at least I'd say. The reality is many companies are built on Ruby and rewrites are hard. Stripe, Shopify, Github, Gitlab and the list goes on. Perl never had this kind of traction afaik - yes many scripts were written on Perl but not many .com companies were based on it.

But I'm not arguing Ruby is well past it's peak - that is (sad, to me) fact because I happen to think it's a gorgeous language but it is what it is. I guess I'll have to get used to Python/Node or maybe switch to low level which is an old and perhaps unrealistic old dream of mine.


> Perl never had this kind of traction afaik - yes many scripts were written on Perl but not many .com companies were based on it.

Were you around for the first (pre-2000) dotcom boom? From where I was sitting (freelancing in London) it sometimes seemed that all of the first wave of dotcom companies were writing their apps in Perl.

In fact, I've often thought that a lot of Perl's current bad reputation stems from this generation's CTOs and dev managers being people who suffered writing those Perl web apps at a time when no-one knew how any of this stuff was supposed to work and careful design went out the window in the rush to get things to market before the bubble burst.


I think Perl lost to Ruby because of Rails. Whilst Perl had a couple of web frameworks - Catalyst, Mojolicious and Dancer - they never gained anywhere near the traction of Rails. I think this was because Perl's early success in the 90s was based on CGI.pm, not frameworks. Catalyst gained a little adoption at a few big companies but it was hobbled by dependence on mod_perl which had a much riskier memory mode for hosting companies than mod_php. Perl was also a bit late shedding its mod_perl legacy by which time Ruby had Rack and Python had WSGI. Despite the brilliant work of Miyagawa it was game over by the time PSGI and Plack appeared.


> I think this was because Perl's early success in the 90s was based on CGI.pm, not frameworks.

Exactly, the second wave of dotcom software was largely written using frameworks that built on the mistakes we'd been making in the first wave.

And because, so many programmers had memories of horrible experiences trying to beat Perl/CGI applications into submission, it was probably too late for Perl even then - although a large number of excellent Perl tools (Catalyst, DBIx::Class, Template Toolkit, Moose, PSGI to name just a few) were emerging at about the same time as Ruby on Rails or Django.


Yeah, A lot of those early web apps were total spaghetti garbage hardcoded to a table layout, so if they survived most of them were rewritten from scratch. Of course perl programmers' tricky tendencies didn't help, but also say ASP and ColdFusion etc have similar reputation issues.


I am only aware of Booking.com that is to this day mostly Perl. Do u know of any specific names?


Zoopla. It's been a couple of years I left, but I believe they still use Perl for the core business logic. There are wrappers/docker images built on top of them, but Perl is doing all the heavy lifting AFAIK.

IME, big older companies have Perl code chugging along, but not very visible. Part of this is also because there's the perception that it is hard to attract developers if the company mentions Perl any where in the job description.


A significant part of Yahoo!'s European and Asian sites had huge Perl backends.

IMDb.


Ruby is so great. I don't understand why this is occurring.


Agreed. It's VHS trumping Betamax all over again. Few things irk me more than Pythonistas crowing over their world dominance but if you look at the top 3 languages - Python, JS & Java - it's clear that language design counts for nothing.


I think it's largely because of Ruby's deep association with Rails. This is nothing against Rails, per se, but so many people only think of Ruby in association with it that they just never reach for it in other contexts. Personally, I think Ruby is a great utility scripting language, really good for the sort of small projects that many people would probably have used Perl for two decades ago.

(Having said that, I suspect that the Ruby community's love of "first, install a Ruby version manager" does it no favors when it comes to adoption for these sorts of small projects, although the same is arguably true of Python.)


what are you going to do then?


I'm semi-retired. I have a part-time contract maintaining a system I worked on a few years ago and I pick up other bits of freelance work from time to time.

And I've been prototyping a few project ideas (in Perl) to see if any of them could be a sustainable source of passive income. Of course, if any of them grow to the extent that they need a development team, I'll need to rewrite them in a more sustainable language.


Maybe he'll wait for the Y2038 crisis :p


Hey, it worked for the COBOL crowd 25 years ago :-)


Amazon's language for storefront UI templates is Perl [1]. When I joined, I couldn't help but laugh that poor developers are dragged through the hell of 5 leetcode interviews to end up working on a UI framework that is 25 years old.

[1] http://www.masonhq.com/sites

Edit: I left in 2013 so I don't know if it's still the case.


To be fair, HTML::Mason was probably the most powerful templating toolkit at the time (Text::Template was there too, but from memory Mason was almost everyone's goto).


Perl seems to still be fairly popular with the OpenBSD folk, since a Perl installation comes with the base system. It seems to be pretty much the scripting language of choice when simple Shell scripts don't do the job or are too slow.


Yup, their package manager and related stuff is written in Perl.


I don't know if they adopted some existing codebase, but DuckDuckGo is the most famous one I know of: https://github.com/orgs/duckduckgo/repositories?q=&type=all&...


I've built a few (small) things in Perl recently:

a) iCalendar and timezone pre-processing for an Arduino alarm clock; Arduino libraries aren't up to the task (and neither am I! recurring events with recurring exceptions is kind of complex), but cpan iCal libraries and timezone libraries seem to work.

b) personally monitoring script, checks a bunch of stuff and sends email (well, cron sends the email, really) if problems persist for long enough

c) something to fetch my DSL sync speed and status (uses Net::Telnet), which feeds into the monitor script, but also used to adjust bandwidth limits for fq_codel to reduce bufferbloat.


Not new, but I'm currently working on a freelance project modernising the front end / UI of a bioinformatics platform that's written in Perl. Also I wouldn't say it's in maintenance mode, there are new features being developed for it all the time.


Maintainance can mean: reuse most of the business logic and port the software to another MVC framework, so it's easier to maintain and add new features, as opposed to keeping it running on life support.


See this discussion from 2 years back: https://news.ycombinator.com/item?id=25021660


Yes, and not just maintenance, new systems.


yes, I am. Web apps and scripting.




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

Search: