Re^2: perl6 or not perl6 ...
by Juerd (Abbot) on Mar 09, 2006 at 19:05 UTC
|
is the difference between Perl5 and Perl6 really that much bigger than the one between Perl4 and Perl5 was?
Yes.
Much Perl 4 code still runs unmodified on Perl 5. While much of the internals changed, the language did not really change much. It got new features, but almost none of the existing language was changed.
Perl 6 code is always different from Perl 5 code. There is a different operator precedence table, operators themselves are different, it lacks some (deprecated) Perl 5 features, and even has a different vocabulary.
From 4 to 5, most of the source was rewritten. From 5 to 6, all will.
And it was about time.
| [reply] |
|
|
You are and are not right. Yeah you can run Perl4 scripts by perl5 while you ... well, they all say you'll be able to run Perl5 scripts by perl6 ;-) But conceptually I think there was a huge gap between Perl4 and Perl5. You've got real references, real datastructures, real lexical variables, objects ... an improved shell became a fullblown general-purpose language. So yes, you'll get some new operators, you get different precedence (ack?!?), you get some more OO features, you get what non-perl-people call function prototypes, you get a brand new source tree, but ... well, it's hard to compare :-)
| [reply] |
|
|
they all say you'll be able to run Perl5 scripts by perl6
For that, plain old Perl 5 is used, albeit automatically. This is a feature of the implementation as it is planned, not of the language.
But conceptually I think there was a huge gap between Perl4 and Perl5. You've got real references, real datastructures, real lexical variables, objects
Those were all additions to the existing language. Yes, it was a big step, and there was a huge gap in between. However, the change was almost fully backwards compatible. It's like changing your house by adding a few floors on top of it. Perl 6 on the other hand will redesign the bottom levels as well, because the Perl 1..5 house was built with Jenga blocks. I think the change from 5 to 6 is more than a huge gap; I think a new language is being designed.
| [reply] |
|
|
I agree with Jenda here, actually. Whether the code written for the older version runs on the newer one is not really the determining factor in my mind.
What counts is that idiomatic Perl 5 is very different from idiomatic Perl 4 in architecture, whereas idiomatic Perl 6 won’t be nearly as different from idiomatic Perl 5, at least in everyday code that does not strain against the limitations of Perl 5 too hard. Perl 4 was really more of a scriptable tool, whereas Perl 5 is a serious language.
Perl 6 does not really reform the way systems written in Perl are to be architectured, it just makes these architectures easier to implement by putting various and sundry premanufactured, well-designed nuts and bolts into the language, so you don’t have to spend so much time building them all yourself.
In syntax, it is a much bigger departure from Perl 5 than Perl 5 was from Perl 4; but in spirit, Perl 6 is much closer to Perl 5 than Perl 5 is to Perl 4.
Makeshifts last the longest.
| [reply] |
|
|
What counts is that idiomatic Perl 5 is very different from idiomatic Perl 4 in architecture, whereas idiomatic Perl 6 won’t be nearly as different from idiomatic Perl 5
Really? Many of the (already frowned upon) idioms are abstracted into functions or operators. This takes away a lot of the (in)famous line noise.
Perl 6 does not really reform the way systems written in Perl are to be architectured
Really? Of course, you can still use the same architectures you used in Perl 5 (as you can still use the architectures you used in Perl 4), but there's a wealth of new paradigms entering the language, with roles hopefully shifting around the idiomatic OO landscape forever. That's just one example, but there are many more architectural possibilities new in Perl 6. Many of which go further than the addition of references, namespaces and lexical variables. (It's not entirely accidental that I name three features that PHP does not have. People manage to use PHP and Perl in much the same way, while PHP lacks these things. Try, to use roles, hyperoperators, or environmental variables, in Perl 5 or PHP...)
but in spirit, Perl 6 is much closer to Perl 5 than Perl 5 is to Perl 4.
Agreed, but then, so is Ruby, which is fortunately not called Perl.
| [reply] |
|
|
|
|
|
|
|
What counts is that idiomatic Perl 5 is very different from idiomatic Perl 4 in architecture, whereas idiomatic Perl 6 won’t be nearly as different from idiomatic Perl 5, at least in everyday code that does not strain against the limitations of Perl 5 too hard.
Do we know enough about Perl 6 code to say what's going to be idiomatic or not?
Perl 6 does not really reform the way systems written in Perl are to be architectured, it just makes these architectures easier to implement by putting various and sundry premanufactured, well-designed nuts and bolts into the language, so you don’t have to spend so much time building them all yourself.
I wonder if we'll see an equivalent of the the "people writing C in C++" problem in Perl 6. While there isn't a huge amount in Perl 6 that's impossible in Perl 5, there are certainly a lot of things that are much easier - including things that are fairly marginal in the Perl 5 world like roles, design by contract, etc.
Combine this with things like macros that don't have any Perl 5 equivalent then I suspect (hope indeed) that Perl 6 solutions are going to be as different from Perl 5 ones as the Perl 5 ones were from Perl 4.
| [reply] |
|
|
|
|
|
|
Re^2: perl6 or not perl6 ...
by monkey_boy (Priest) on Mar 09, 2006 at 14:24 UTC
|
| [reply] |