Re: From Perl 5.10 to Perl 6
by jethro (Monsignor) on Dec 01, 2008 at 04:42 UTC
|
Simply said, the difference between 5.8 and 5.10 is small. There are some nifty new features but if you don't write "use 5.10" in your code you can't even use them.
perl 6 on the other hand is a mayor rehaul of the language, even perl4 to perl5 was a much smaller step. Your code won't run in perl6 without some rewrite, period. For example the way how sigils ($,@,%) work changes.
But that doesn't mean your perl5 code won't run anymore when perl6 is here, because perl5 will still be available as one of the languages (together with perl6) that all compile down to a virtual machine called parrot. If all goes according to plans you should be able to mix perl5, perl6 and other languages in your code.
| [reply] |
|
|
Simply said, the difference between 5.8 and 5.10 is small. There are some nifty new features but if you don't write "use 5.10" in your code you can't even use them.
That's not true. Some of the new features, even some nifty ones, are always available in 5.10. '//' for instance, and the new regexp features. New keywords however, which could conflict with existing code are only enabled if you use '-E', 'use 5.010' or 'use feature qw(...)'. This include 'state', 'given/when' and 'say'.
But that doesn't mean your perl5 code won't run anymore when perl6 is here, because perl5 will still be available as one of the languages (together with perl6) that all compile down to a virtual machine called parrot.
That's only true if you run Perl6 on an implementation that uses Parrot. Pugs for instance runs on top of Haskell and doesn't need Parrot (But I don't keep up with Pugs, it may very well be that it now has the ability to emit one of the Parrot internal languages). Of course, someone has to to make perl5 run on top of Parrot as well - currently it doesn't, and the only project I know of that tried to do this (Pony) died a slow death several years ago. Perl1 has been ported to Parrot though. Oh, and I haven't heard any solution of how to port XS code to Parrot short of rewriting it.
| [reply] |
|
|
Oh, and I haven't heard any solution of how to port XS code to Parrot short of rewriting it.
Linking Parrot against libperl, and sharing runloops?
That's probably not easy, but conceptually possible. (And notice that smop, another possible Perl 6 backend, already has XS bindings).
| [reply] |
|
|
the german wikipedia article mentions that the plan is (atm) to have Pugs compile down to perl5, Parrot, Haskell ...
| [reply] |
|
|
| [reply] [d/l] |
Re: From Perl 5.10 to Perl 6
by ww (Archbishop) on Dec 01, 2008 at 03:38 UTC
|
Depends on your code.
Some 5.10 capabilities don't exist in 5.8, for example, so if you use them and your host is still at 5.8, they won't work. (For details, read the relevant perldeltas).
As for Perl 6: we can listen tonight to a weather forecast for tomorrow... but we won't know if the weather-guessers got it right until tomorrow.
As to your specific "things" -- those wise in the plans for 6. can surely tell you yes or no, but "things like" (emphasis supplied) is too vague to let you even hope for any more than a forecast. | [reply] |
Re: From Perl 5.10 to Perl 6
by f00li5h (Chaplain) on Dec 01, 2008 at 06:49 UTC
|
Simple, just run your test suite on perl 5.8 and see how many fails you get out of it...
@_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;
| [reply] [d/l] |
Re: From Perl 5.10 to Perl 6
by JavaFan (Canon) on Dec 01, 2008 at 11:31 UTC
|
But will it run on Perl 6 when it becomes the default Perl installation?
Unlikely (although promises have been made implementors of Perl6 will know how to run Perl5 as well - considering how hard it is to keep 'perl' running Perl5, I wouldn't want to bet that once Perl6 is available, it'll run all Perl5 code. Furthermore, which version of Perl5 will it run? 5.6, the version of Perl5 that was current when the Perl6 effort started? 5.8? 5.10? 5.12? And will that be just pure Perl, or will that include XS as well?
But it's certainly not the time to worry about it now. Perl6 hasn't been close to be production ready, and even when it's production ready, (Linux) distros have to pick them up, and then hosting companies have to start supporting them. Considering that after a year of 5.10 being available most hosting companies still offer 5.8 (or even 5.6), I wouldn't count on having to worry about Perl6 in the half dozen years. Some years ago, people tried to guess the Perl 6 release date. Most guessed dates have passed years ago.
Personally, I'd be surprised to see a useful perl6 out before 2015. And I wouldn't be surprised if I never have to code in perl6 because it either never gets finished, or it just won't catch on the say Perl5 did.
So, to sum up, I don't think it make any economical sense to spend time worry whether the code you write today will run on perl6. When (if) Perl6 comes around, your code has been rewritten for some other reason anyway.
| [reply] |
|
|
| [reply] |
|
|
Well, I was just mimicing the sentiments of the OP. But as for 'competent' people, know of any major Perl shop that has moved from 5.8.x to 5.10? (With major I mean shops like Morgan Stanley, booking.com, MessageLabs, etc).
I certainly don't.
| [reply] |
|
|