by rjh29 · 2y ago · 0 comments
While python got dataclasses and type checking perl got... a few syntax upgrades many of which never left experimental and ended up being deprecated. The smartmatch implementation was beyond terrible, and implicit arrayref arguments should have never made it past the design phase. And still no native object/class system. Still no working exception handling!
I don't know if the perl runners are incompetent, badly organised or just hamstrung trying to guarantee backwards compat for all the legacy code. But as a Perl user it has been very frustrating to watch.
It isn't hamstrung; it's a language that has stayed itself. If you want to run a perl script you just use your system perl (and it doesn't matter how old or new the OS is). If you want to run a python script you have to set up a container then use a package manager to setup an entire dedicated python and libs just for that script. Python may have acquired many nice features and refactorings but it stopped being a dependable shell language.
It traded run time complexity for write time ease; it's that way with all popular languages eventually. Not being popular after the Perl 6/Raku debacle is the best thing that could've happened.
This does kind of remind me of the Python 2/3 and Java 8 vs newer versions situation - where both the older and more stable version is maintained, but most of the development effort moves over to the new version. The good news is that for a while you get a really stable platform, but the bad news is that eventually it'll get deprecated and you won't find many new libraries and such developed for the old version anymore.
While something like Perl and Pascal (especially with Lazarus; a really good combo for building GUI apps and still an okay language, except the ecosystem is limited) are unlikely to disappear anytime soon per se, the flip side is that some of the existing libraries and frameworks might fall out of being maintained, or even entire projects be abandoned, like BackupPC, for example, with nobody really stepping up to keep them alive: https://backuppc.github.io/backuppc/
You mean camel? PHP is the elephant. ;-)
>A group of blind men heard that a strange animal, called an elephant, had been brought to the town, but none of them were aware of its shape and form. Out of curiosity, they said: "We must inspect and know it by touch, of which we are capable". So, they sought it out, and when they found it they groped about it. The first person, whose hand landed on the trunk, said, "This being is like a thick snake". For another one whose hand reached its ear, it seemed like a kind of fan. As for another person, whose hand was upon its leg, said, the elephant is a pillar like a tree-trunk. The blind man who placed his hand upon its side said the elephant, "is a wall". Another who felt its tail, described it as a rope. The last felt its tusk, stating the elephant is that which is hard, smooth and like a spear.
https://en.m.wikipedia.org/wiki/PHP
See the Mascot section.
Postgres is the elephant.
Then 2.7 came out.. and 3.0...
There's https://metacpan.org/dist/perl/view/pod/perlclass.pod, which (granted) is experimental, but it's actively being worked on.
> Still no working exception handling!
There's https://metacpan.org/dist/perl/view/pod/perlsyn.pod#Try-Catc... which is now (5.40) no longer an experiment, _aside from_ the use of `finally`, which warns.
> trying to guarantee backwards compat for all the legacy code
Not "all", as there are indeed deprecations added over time, but _most_. I really, really like that I can, more often than not, take a program I wrote decades ago and it will still run properly.
That wouldn't have changed with Perl 7, because Perl 5 would have been put into "long term maintenance mode". In fact, backward compatibility would have been even stronger, because all the changes would have gone into Perl 7.
I'm personally of the idea that enough backwards compatibility _should_ be preserved, but not _so_ much as to inhibit new/better syntax constructs and the like.
But honestly it's the sort of thing that is more like "I'll know it when I see it" more than anything.
Re "long term maintenance mode", there's the not so small matter of how many people can, in fact, actually develop perl. The codebase is large and full of many traps. It's a difficult, but not impossible, codebase to contribute to.
My sincere hope is that enough things will get out of "experimental", including quite a bit more of the "class" feature, for the end result to be enough to be called "7" and we'll go from there.
Basically... mostly a marketing thing, as today's 5.40 is way, way different (and better in so many respects) than 5.8 or 5.20 or even 5.32... but the (minor) version number doesn't show that.
A "perl 7" would.
Yeah, and that was one of the main reasons cited when they announced Perl 6, back in 2000. 24 years have passed and it's still an issue.
"Cool kids" languages like Python and Rust really put in the mind of people that a program written two weeks ago must be upgraded to run on the new version of the compiler or interpretor. Meanwhile there always have been languages like C# or C where a codebase from 15 years ago will compile and run just fine.
You can fix this by using -Wall -Weverything -Werror to ensure in 15 years time, the code won't compile any more.
I’d actually go even further and say that the only appropriate time to use -Werror is when running tests for code that hasn’t been merged yet… once it’s “released” you don’t want to use -Werror any more.
Ditto automatically running unit tests/etc too. (Perl is actually a major offender here… last time I used Perl, installing a module from CPAN would run its unit tests by default. Why do I, some random person installing this module, care if the tests pass now? The tests should have been run prior to this being published! I have horrible memories of the DBD::MySQL package failing to install because it ran tests that assumed localhost was running a MySQL server with anonymous auth enabled and the whole module failed to install if that wasn’t the case.)
I am not aware of anything in current Python 3, that has broken backward compatibility to an earlier Python 3.
Some dependencies are implemented in ways, that will require you to use newer Python versions. Often those are packages, which are glue for lower level libraries. Like tensorflow.
Perhaps I am describing the same thing as in JS ecosystem. But for some reason neither have I migrated to another way of defining my API routes in Django lately, nor have I had any need to in the last couple of years. I guess in the JS world there is just so much more half-backed stuff that gets hyped to no end, and this job guarantee is celebrated as "quick evolution".
Here's a list of things that were removed from Python in 3.12, most of were deprecated after the 3.0 release.
As is tradition this was the subject of a very engaging talk at the most recent TPRC: https://www.youtube.com/watch?v=0x9LD8oOmv0
Useful talk deals in benefits and tradeoffs (as the linked article demonstrates in spades). Useless talk deals unsupported “should”s.
Python's dataclasses are just a simplified copy of the existing attrs pypi library. The implementation of them is a mess. I use Python every day and have plenty of nice things to say about it, but dataclasses and python types would be close to the top of the list of things I think are done most poorly in Python.
For ML stuff there’s no way around using Python (pytorch, TensorFlow, etc. etc.). While I appreciate that ML researchers make their models available to run locally, if you’ve ever run LLMs or SD, it’s very clear the focus is on getting models out of the door before others. But man is it a hot mess: every model needs its own Python version/installation from various sources (OS provided, github, package repos, python.org downloads, etc.), the code bases being rife with dozens of module and environment managers and other meta crap that obviously doesn’t cut it, Python devs using a dynamic language but then want types/annotations badly, etc etc. Sorry but from a SW engineering PoV, Python is pure and utter trash (it started life as a better BASIC for learning after all). I’m particularly puzzled by developers choosing/advocating Python for system administration and as shell replacement who now have to ship a locked–down Python version and package repo such as RedHat and Apple.
Perl 5 code, by virtue of being frozen for over ten years in anticipation of what’s now called Raku, has a slightly better chance to run OOTB. But there’s no guarantee: recently came accross 2000ish Perl code using jcode (lib for Shift-JIS and other CJK two byte encoding) that I couldn’t run because jcode uses hashing sigills that were removed from Perl since or something.
I read that as "Perl has remain stable for over 20 years".
The perception that it has stagnated appears to be poor marketing for the new features. For example, this article from 2022-09-08:
https://stackoverflow.blog/2022/09/08/this-is-not-your-grand...
https://news.ycombinator.com/item?id=32767218
Which starts off with "If you were to search the internet for recent articles about Perl, you might well be led to believe that the language hasn't changed in the last twenty years."
My guess is that since older versions of Perl are mostly adequate and code targetting them continued to work year after year, there was little motivation to check out new features of Perl.
Luckily Perl is so powerful that third party modules can do pretty much anything. There have been modules out for 10+ years that hack the parser and added function signatures (with types!) to the language before Perl did. Unfornaturely they're buggy and if you make a syntax error the output makes no sense :P
Both of these describe a write-only language, and Perl doesn't disappoint. Yes, I have seen well readable Perl code, it exists. But the language doesn't nudge you that way.