by lordofgibbons · 1y ago · 0 comments
I remember at a former company, we had a major migration away from Perl 12 years ago. The Perl code base was considered extremely ancient even back then.
To avoid creating new Perl code from scratch we created a REST API many years ok which new frontends and middlewares use instead of interacting with the core itself. That has been successful to some extent as we can have frontend teams coding in JS/TypeScript without them needing to interact with Perl. But re-writing the API‘s implementation is risky and the company has shied away from that.
Fixing API bugs still require to dive into a Perl system. However, I found it easier turning Python or JS devs into Perl devs than into DB engineers. So, usually, the DB subsystem bears the greater risk and requires more expensive personnel.
If you let your codebase get into an "ancient" state then that's a problem of your own creation rather than that of the language or system in which it is written.
Perl just hovers them up and does whatever processing. We did test Python but it just felt clunky in it's habits and felt lacking in terms of performance such as stalling in building a dictionary list of files to work with. Perl may be one of the older languages, but it still holds strong.
If Perl is supported for your $OS your script is guaranteed to execute. Sure, adjustments may have to be made if you're targeting the underside of the rainbow such as Windows but it's trivial for *nix hosts. Migrating from Ubuntu to Debian, BSD? -- 99.9% chance your script will run.
I am bias, in that their isn't anything majority wrong with perl. It was used as the main language back in the 80's for a reason and Perl's ecosystem (cpan) is still pretty comprehensive and still holding weight.
As it's not taught anymore due to newer trends this is causing it's shine to dull and it's overall presence dropping away. I wouldn't disagree that new languages boast optimism in to the future of programming technologies but with perl it has been battle tested and just works.
The rest of your comment makes me think the "non-trivial" was a typo and meant to be something else.
The advantages are the same as they have been for years: cross-platform compatibility, one system to run all aspects of a large project, the flexibility to get the job done in the simplest, most efficient and most maintainable manner.
One caveat: we don't do any MSWin32 development at all. I'm vaguely aware that there are some extra considerations on that O/S but it isn't something which we have to deal with.
That's the point of PCRE though - you get Perl's excellent regex implementation in more places.
Perl 6?
It was so breaking they don't even call it Perl anymore.
What I want is TITBWTDI (this is the best way to do it).
Keep in mind though that the current state of Perl includes being in the process of getting a native object model baked into the language core. So that’s still in some flux but it’ll be better than choosing among eight different external object model libraries. It’s also more performant. The docs for that I’m not sure are in a bound paper book anywhere yet, but I’d happily be corrected.
It's dear to me because it came along at a time when I needed short breaks from thesis writing.
[0] https://www.oreilly.com/library/view/perl-best-practices/0596001738/
[1] https://metacpan.org/dist/Perl-Tidy/view/bin/perltidy
[2] https://metacpan.org/pod/Perl::CriticIt would hiccup where it would write the existing perl codebase in to a hallucinated python syntax but this was two years ago.
Now, I don't actually believe this, because that puts Perl way ahead of Rust (currently at #18). So the big thing I'm taking away from this little research post is that I no longer trust the Tiobe index. Too bad - it felt pretty reliable for a long time.
a) there is probably several orders of magnitude more Perl code running out there in the wild than Rust?
b) the TIOBE index was ever meaningful?