Live data from Hacker News

Differences Between Perl 5 and Perl 6

design.perl6.org

71–80 of 127 posts

Re: Differences Between Perl 5 and Perl 6

#71
post #44

Earlier quoted context omitted.

Perl 6 developer here. Perl 6 is not an automatic upgrade path from Perl 5. We don't expect anybody to rewrite huge amounts of Perl 5 code in Perl 6. Perl 5 is going to be maintained separately. We do provide tools to augment Perl 5 code with Perl 6 code, and the other way around. There's Inline::Perl5 for Perl 6, and Inline::Perl6 for Perl 5.

IMHO Perl 6 will not catch on / be even mildly successful without a clear upgrade path from Perl 5. The ask for people to use Perl6 is a huge one given it's basically a completely different beast that just resembles Perl5. Without pointing out where Perl6 excels (in comparison to Python/Ruby not Perl5) this will probably be a non-starter for most people. (this is from somebody who did his fair share of Perl5 in the o…

Sorry I don't get it. Why would I rewrite an entire ecosystem in a new language, especially when Perl 5 is very well supported. Perl 5 code will remain as is.

Perl 6 is for new projects. And if I'm familiar with Perl 5, it makes all the more sense to use it for my new projects. For non Perl programmers it makes a nice new language to learn.

Re: Differences Between Perl 5 and Perl 6

#72
post #43

Do the changes to the regular expression syntax seem woefully under-publicized here? Was: $str =~ m/^\d{2,5}\s/i Now: $str ~~ m:P5:i/^\d{2,5}\s/ # :P5 indicates Perl5-compatibile regex syntax Was: $str =~ s/(a)/$1/e; Now: $str ~~ s:P5/(a)/{$0}/; # $1 is now $0 I actually find the change from $1 to $0 particularly disturbing, since that is well standardized and group 0 normally refers to the whole matched pattern (tho…

It seems "disturbing" is the good word here, as the kind of changes in the semantics or notation between Perl 5 and Perl 6 almost guarantees that most potential users would have to decide if they are going to reject using one or another: The need to "read differently" on the distant look similar code demands too much from the people who'd just like to "get the job done."

What's that $1? Well it's the first match if it's Perl 5 but it's a second match if it's Perl 6. But don't worry, the other things in expressions also have sometimes other meanings.

Re: Differences Between Perl 5 and Perl 6

#73
post #26

Earlier quoted context omitted.

Perl6 is really a strict supserset of Perl5 in this way. Perl6 is at least as good as Perl5 for everything Perl5 is good at. But Perl6 is way, way more than that.

I'll probably be trouted by a Perl monk for saying it, but sometimes less is more.

Depends on the problem on hand. You can't really replace lifts with thousands of ladders, when you are building a sky scraper.

Re: Differences Between Perl 5 and Perl 6

#75
post #63

Earlier quoted context omitted.

> Why? Is that an expectation that comes from some other language? No, the convention that (thing that can be viewed as a collection of subelements in several different ways).(plural name for one kind of subelement) is a property/method providing a collection of the subelements of the named type is not only common in other languages, it is also quite common in Perl 6 -- and even followed (aside from chars) in the Str…

I don't necessarily disagree with your reasoning, but I vaguely recall there was quite a bit of debate about the naming of these methods when they changed, and I don't recall the arguments. I have a feeling it's too late to change them now, so it may just have to live on as a quirk of the language.

> I have a feeling it's too late to change them now, so it may just have to live on as a quirk of the language.

I can see that, and I don't think its all that bad, just suboptimal, and confusing based on more than just expectations shaped by other languages.

Re: Differences Between Perl 5 and Perl 6

#76
post #6
post #4

Note that its more or less "how to write perl 5 in perl 6" Sorta like the old F2C, Fortran to C, converter. You don't get idiomatic C, but you do get a fortran program that compiles and runs as a C program, more or less. Some parts of perl6 are annoyingly urbit-y, come on, you guys just had to rename ARGV and rename scalar and the for-foreach transition is ridiculous. I suspect at least a decade of people pointing at…

It might be too much stress or too little coffee, but I don't understand the last part. Why would you need to replicate behaviour and tests? You mean it will take time before you trust the "use Perl 5 code in Perl 6" bridge that is worked on, so it isn't enough to run the Perl 5 tests and then use that code in Perl 6? (Or you think there will be bad interactions with Moose and Perl 6 OO?) Edit: Huh, I was shortly un-…

Because you cannot trust the 5-to-6 translators yet, so you have to test the translated perl6 code in perl6. It's a completely new VM, with new syntax, compiler and run-time.

Even with Inline::Perl5 you need to test the implicit 56 casts with the perl6 vm (which might be rakudo or some other engine).

Moose contains only a small subset of the Perl6 OO, and has also different syntax. E.g. in perl6 types lead to optimizations, in Moose to pessimizations. Rewriting in Perl6 is always preferred, as Perl6 is a much nicer language.

Re: Differences Between Perl 5 and Perl 6

#77
post #66

Earlier quoted context omitted.

Perl 6 developer here. Perl 6 is not an automatic upgrade path from Perl 5. We don't expect anybody to rewrite huge amounts of Perl 5 code in Perl 6. Perl 5 is going to be maintained separately. We do provide tools to augment Perl 5 code with Perl 6 code, and the other way around. There's Inline::Perl5 for Perl 6, and Inline::Perl6 for Perl 5.

Is there a Perl 5 EOL being discussed? Or, if Perl 5 and Perl 6 really are two completely separate languages separated by a similar syntax, then what comes after Perl 5 in the Perl 5 language? Will it forever be 5.N, 5.N+1, ...? (And, I guess, will there forever be 6.N, 6.N+1, ...?)

Pretty much. Perl 5 and Perl 6 have different maintainers and will continue on separately for the foreseeable future. Some in the Perl 5 community wouldn't mind a name change just so the Perl 5 v.s 6 naming scheme isn't an issue but it's not likely to happen.

Re: Differences Between Perl 5 and Perl 6

#78
post #11

Was: my $len = length($string); Now: my $len = $string.chars; My intuitive interpretation of that syntax would be "given a string, return a sequence containing its characters, in order". Or is that overlading on return type, and do you get the behavior I would find intuitive if one assigns to an array? Even if that is true, I find that ugly. I would prefer more explicit code, for example my $len = $string.chars.#; Si…

this is a typo error actually: Now: my $len = $string.length; http://doc.perl6.org/type/Str#method_length EDIT: I don't see any contact section on their page to let them know

Sorry about that, I've jumped a bit too fast on that one

Re: Differences Between Perl 5 and Perl 6

#79
post #47

Earlier quoted context omitted.

I expect it's based on the /slap emote in IRC. Wikipedia [0] has a page on it, from which I swipe the follwing: `When someone does something inadvisable that they had the experience and intelligence to avoid, you may likely see the suggestion that they be "trouted"` Trout slapping originated in 1995 with internet relay chat (IRC). While in an IRC chat room, the IRC client mIRC would allow users to enter the command:…

Wow, that's a blast from the past. Did it really originate in mIRC? Somehow I feel like it predated that, but maybe just because I didn't run Windows.

I first encountered it in the mid-to-late '90s, and it was definitely considered an IRCism back then (in that IRC was the only place you saw trouting), but I had no idea it originated as an mIRC builtin.

Re: Differences Between Perl 5 and Perl 6

#80
post #15

To reuse the recent slogan, the only thing that changed is everything. It's a new language with its own internal logic. I used (and still use) Perl 5 because it made some specific things easy to make (various processing of data). I still don't know for which kind of tasks Perl 6 is the best choice. But maybe the language is simply too young for it to be obvious?

Perl 6 is more ugly than Perl 5. Fuck Perl 6! Long live Perl 5 HAHAHA
Post reply on HN