Perl 7 - the current plan (document and core team discussion)
perl.topicbox.com/groups/perl-core/T4bad78027...Posted Mar 24, 2021, 2:36 AM UTC
Posted Mar 24, 2021, 2:36 AM UTC
surprised this wasn't posted already, but tl;dr seems to be:
-e (for strict+warnings, unclear on other features)Discussion on Hacker News
Nicholas Clark's comments +100000000000000000000000000000000000.
From my uneducated armchair with an old Camel book or two propping it up, there's something that Perl and the smarter Perl writers are better qualified to do that other languages and communities having this upgrade problem couldn't. Or can't.
That's to take a leaf out of the book of the ancients: s2p and a2p
It is conceivable that everything in Perl 7 is going to have a counterpart - albeit perhaps less efficient - in Perl 5. Thus it ought to be possible to parse/transpile Perl 7 down into a Perl 5 program, and likewise vice-versa.
In theory, p7to5 (for want of better name) could even be written in 7, then transpiled to 5 by putting it through itself in order that older Perl 5 systems can use it.
The difficulty (or lack) of trying to write such a converter, and the ensuing change of efficiency of the result might also be a gauge on whether 7 is "too different" to 5, whatever that might mean.
I will want to run my old code with use v5.12; in Perl 7 and 8. I don't want to install multiple versions of Perl on my computer.
This proposal might be good enough. I see 2 things in this proposal that would break compatibility:
use v7; in every file. This will break some scripts, unless you edit them to add use v5; or no strict; or whatever the script needs.open FH, indirect calls new Thing, and awk-style multidimensional arrays $hash{$x, $y}. This will break some scripts, unless you use a CPAN module to bring back the feature.I have long avoided the weird features and preferred open my $fh, Thing->new, $hash{$x}{$y}; and my typical use v5.12; might prevent some trouble. My old code might continue to run in Perl 7 and 8.
I didn't like how Python 3 broke strings in a big way, so I needed to keep Python 2 for years just to run Mercurial. Ruby made smaller breaks (Ruby 1.9 broke characters, 3.0 broke keyword arguments). I haven't needed Ruby 1.8 for a long time. I want Ruby 2 and Perl 5 to disappear like Ruby 1.8 did.
I want Ruby 2 and Perl 5 to disappear like Ruby 1.8 did.
This is particularly why my argument in Perl 7 By Default is that the explicit version scope is the best way to make Perl 7 (or 8 or ...) the default Perl, so the older ones don't need to stick around forever, the same way older Perl 5s eventually fade because upgrading has little risk.
Would perl -Mv5.12 myscript be sufficient to run an old script unmodified with Perl 5.12 semantics? Or even PERL5OPT="-Mv5.12" perl myscript … a user account for a system service could have PERL5OPT="-Mv5.12" in its .profile which would be the default for all scripts it runs, could it not? Or will there be a PERLV7OPT environment variable...
-Mv5.8 might not fix old code, because of modules. You might need to add use v5.8; to an old module to run it in new Perl. But you can't add use v5.8; to a new module that needs the default v7 features. I guess that you add the use v5.8; to whichever module got a compilation error. This is with the proposal that use v7; is the default in some future perl.
-Mv5.12 isn't for old code, because perl 5.12 didn't use v5.12; by default. Every perl 5.x, by default, tries to be compatible with versions before 5.10; see perldoc feature. So if use v7; is the new default, but our old script needs the old default, then we would need use v5.8; or another version before 5.10.
Perl 8 is years down the road. That this discussion is happening means that developers will have years to decide how to handle it.
I suppose it could be worse.
If I'm reading this right, perl v7 will continue to run unmodified legacy v5 code. It would take "use v7;" to activate potentially code-breaking features.
This would extend the useful life of legacy code, which companies by and large cannot port forward, for a few years longer.
Still, it is unfortunate that p5p will no longer be permitted to make new v5.x.0 releases. It will result in the phasing-out of perl in the enterprise, and if this plan to rejuvenate perl among hobbyists doesn't work, it might never come back.
The python folks ROUTINELY make breaking changes (they really have no effing clue what semantic versioning is) and yet the world does not seem to fall apart. It's really really really really nice that you can still run some 20 year old piece of code unmodified, but guess what? That code owner is not upgrading their Perl installation anyway - they're still running 5.8. So, as was attempted to do last summer and got shot down, can we STOP catering to that person? Let them keep running 5.8. Meanwhile these upgrades are EXACTLY the kind of thing that would INVITE hobbyists to keep working with the language. Stagnation kills.
If a CPAN module you really need to use kept making little breaking changes, would you personally (u/mpersico) stop using it or keep adjusting your Perl code? The likelihood is very high that you’d just keep adjusting (even if you also got angry about it).
If you (u/mpersico) had a crusty old script written in m4 running somewhere in your systems, and the m4 maintainers broke it, especially repeatedly, how would you proceed? Dive deep enough into m4 to be able to adjust it and then do so, or migrate away?
Now switch your perspective to someone who doesn’t know Perl, and change Perl in the first example to that person’s primary programming language (whatever that is), and m4 in the second example to Perl.
Then, from a business perspective, consider how many people are employed as Python programmers vs how many are employed as Perl programmers.
The python folks suffer no consequences from breaking code left and right because the world is drowning in python programmers. Companies can easily allocate programmer time to fixing python code. This is not the case with legacy perl code, which might have one maintainer in an entire Fortune 500 company.
Your point about legacy code being run by old perl has an element of truth to it, but it's a little more complex than that. The legacy perl needs to be supported by whatever version of RHEL/CentOS hasn't yet been phased out of production. In most companies this is one or two versions behind the oldest supported version (RHEL5 or RHEL6, today, running v5.8.8 and v5.10.1, respectively).
This ties companies' ability to run their legacy perl infrastructure to Red Hat's release schedule. If their release history is any guide to future behavior, companies might still be running RHEL8 in 2033. If we assume RHEL9 will still support perl v5 or non-code-breaking v7, that bumps the deadline out to 2037'ish.
That's a long time, but not forever. I don't plan on retiring by then.
On the upside, this is also a lot of time in which to try different things to revitalize perl's popularity. If v7 doesn't turn things around, perhaps something else will.
This ties companies' ability to run their legacy perl infrastructure to Red Hat's release schedule.
It's too bad Red Hat has neither the ability to charge its paying customers money to support software that's no longer supported upstream nor IBM's gigabucks backing it.
Oh well, I guess p5p will have to keep supporting Red Hat/IBM's paying customers for free. Can't see any other solution. We've tried nothing and we're all out of ideas.
I don't particularly mean to be snarky at you, but it's baffling to me why it's p5p/CPAN's responsibility to cater to paying customers of a third party that's not contributing much to the ecosystem.
This is a matter of consequences, to me, rather than fairness.
If supporting the viability of legacy perl in the enterprise has the consequence of more perl use, and more commercial demand for perl skills, then that is the benefit to compare against personal cost when making development decisions.
If we don't care about companies porting their legacy perl infrastructure to python for lack of viability, then there's less reason to make any effort to support legacy users. We can totally say "it's not fair!" and spend our time and energy elsewhere.
It boils down to what consequences are important to each of us as developers, and in that light I think it should be the choice of individual developers, and not imposed from above by the PSC.
Why do we need new v5.x.0 releases if v7 can run unmodified legacy v5 code?
It might, it might not. It depends whether the argued feature of "changed defaults" becomes a thing or not. E.g. if Perl 7 becomes strict-by-default, then it will no longer run any existing Perl 5 code that doesn't begin `use strict`. This is being proposed by some people as a serious suggestion.
perl 8
Stop it pls
What do you want to stop specifically?
Major version increments.
I think this would just kill off Perl, most warnings are useless. Very few old projects would update, causing mass breakage. People like me employed in maintaining large old perl code bases would just find it easier to give in and let the younger generation port it all to whatever flavor of the month they love.
This would be huge headaches for Linux distro's etc. Personally I'd look at improving Perl XS support and ways Perl can work with C and C++, have a look at math processing times and see if some of the core functions could take advantage of modern CPU. Leave the core language design alone other than adding GPU processing support. Just my two cents.
Concur, I have several XS modules for c dlls and would love improvements to XS.
We Chrome versioning now?
I have lots of feelings about what I want to see in Perl 7 and the role of "use v7", but honestly they're all just details. The most important thing about Perl 7 is just that it will exist and be a statement to the world that Perl is not dead, and Perl6/Raku is not the only future of Perl.
Did that do anything for FORTRAN 2003? How about Ada 2012?
I'm not sure what became of either of those, but the realistic aim here surely is to slow the move away from Perl rather than an honest belief that people will be drawn to it? I don't really see how there's a way to be an attractive language to people who don't already use it without annoying a large chunk of the people who do know and use it already.
I'm in favor of attempting both, but if I had to put my stake in the ground on any given issue as to which to favor, then I'd agree that the more realistic option is to favor retnetion.
Retention alone is not sufficient. People leave for other reasons outside of the language's control. I stopped being a day-to-day developer in Perl because it wasn't what I found a job doing. In fact, companies that take the "we'll hire good programmers, and we'll teach them the language we use," attitude are the ones that actually make or break new (or recovering) languages.
I understand that Fortran is not dead. There is Fortran 2018. There is an "early prototype" of the Fortran Package Manager, which might become like CPAN. I view Fortran in the same way that another person might view Perl: it's an important language, but not the language of my code.
[deleted]
Well, Lisp did survive. It was created in 1956, and it didn't just survive, but has grown into a modern language. Common lisp is still being widely used today, even at organizations like NASA. Although we are not using John McCarthy's first lisp, we definitely have modern dialects of lisp like Clojure (used at Apple, NASA, Walmart etc.,) and LFE. In the same way, I think that perl will have a bright future if it adopts to the needs of the world just like lisp did. Perl is an amazing language.
On the other hand, FORTRAN did not survive because there came many better replacements for it with rich set of features.
PERl WILL NEVER DIE OR BECOME OBSOLETE. New dialects of perls will probably come from the community in the future, and the ideals of the perl will be carried forward for decades to come.
In far far future, we might even see perl hackers hacking in perl in the spaceship for passing the time while on their way to the nearest galaxy😀 . And so will hackers of the other beautiful languages.
CL is really its own language that just happens to be a superset of Lisp 1.5, sort of similar to C/C++.
Lisp 1.5 is more or less a dead language (in so far as any programming language can actually "die").
Tell that to all of the mathematicians who still use it. Also Fortran 2018 would like to have a word...
That hasn't happened in 30 years, why would it happen today?
There have been two languages that I know of that could be considered directly related to Perl: Perl 6 AKA Raku which never really made it out of the starting gate and Ruby which is about as Perl-like as Java is C-like.
Neither was widely embraced by the Perl community, and had to seek their own communities as a result (Ruby successfully, Raku not so much).
Correct, no guarantees. Perl might just die anyway, but I think Perl 7 will help.
It will help if it's a modern language. I don't see any way for it to help if it's just Perl 5 with some defaults modified.
My take is the situation is a little worse than this: the idea that making some little technical tweaks is going to suddenly improve everyone's opinion of perl seems like a real stretch (far more likely, presuming the in-crowd pays any attention at all, is to intone "too little too late"). It is however entirely possible to push people away from perl even faster-- if you hit people with breakage-on-upgrade with their old perl code, I think in many cases they'll be more likely to re-write it in some other language than they are to fix the old, no matter how small the fixes.
[deleted]
Take away the cargo-culted math libraries that everyone has been using since the 1990s, and there isn't much that's done in Fortran anymore.
[deleted]
It's still sticking around in various HPC niches (eg climate modelling).
This! Personally was losing hope up until end of last year and then out of no where it seemed like a bunch of people were suddenly all about Perl and moving it forward. Made me very happy and re-energized my desire to keep using the language rather than just moving over wholesale to something else.