1) Will have the same fate as Haskell...
2) Python3's snake will eat the Perl6 butterfly
3) Only ParrotVM will be succesfull
4) Perl6 will become the new Java
5) faggot
I've seen some horrible code in perl6. Nastier that perl5 line noise.
perl6 -e 'my @g = 0, 0; print "0.0"; loop { my %set;
++%set{@g[$_] +^ @g[* - $_ - 2]} for 0 .. @g/2 - 1;
my $mex = first { !%set.exists($_) }, 0..*;
print $mex; push @g, $mex }'
Took that from a perl6 blog aggregator
Of course, you can write it in a much clearer way, but we know that this profession is filled with smart asses that like to write code only they understand.
>>13
I am criticizing it from the ENTERPRISE perspective. I am not saying the code is inneficient or that it does not work. But you should be able to say what it does just looking at it a few seconds....
This mess is one of the reasons why Perl5 is rejected on enterprise projects. I have seen project managers saying "No, perl is not allowed. Use something easier to read".
And lets face it. The enterprise is where programming languages reach their full potential. Of course they might be exceptions.
I would really like to see Perl6 reach the enterprise, big time. I like Perl5 a lot, but i had little luck using it into new projects.
Perl6 is just a specification. Maybe someone will come with some ENTERPRISE flavor, forcing some coding styles (or forbidding some stuff like +^)
>>13
That code was not meant to be enterprise, we both know that. And project managers, well, I won't get into that, but it is not hard to write easy to read Perl.
>>13 +^
Is one of the best things about Perl6. It's clever and innovative. If you want to trend towards ENTERPRISE you will always end up with something strangely similar to Java. NO EXCEPTIONS. So why even to try?
>>15
Nothing is stopping anyone from making a module for that. You won't get it as a normal pragma but then again, who wants to have enterprise coding practices shoved up is rear? We have Java and Sepples for that and they do it well.
Seriously, who the fuck can read Perl. I'm not even joking. People just like it so they can show how OMG clever they are. Enterprise programmers laugh at YOU.
It certainly has lots of operators, but Perl6 is a necessity for any "Modern Perl" developer. In my opinion, the amount of operators is a little detail compared with the conceptual improvements of Perl6. The type system, roles, junctions, etc can't be bad for any programmer.
Moose did a great job giving Perl a good OOP syntax, but something better is needed.
So, Perl6 as a replacement for Perl5+Moose is very good, IMO.
I can't wait to have a 1.0 version. I'm still playing with Rakudo Star, though
Perl 6's idea is almost perfect: It's Lisp with braces. You can do what the fuck you want with the language, define new operators, it has macros and other ``abstract bullshite''.
Perl 6 fails for being FUCKING BLOATED. It should be a ``small'' core: macros, a way to define operators, some basic data types and some basic operations to use them, classes, junctions, pattern matching and the Perly stuff (regexen, grammars, etc). Then let the user build on top of that core.
Name:
Anonymous2011-02-16 18:56
>>10
In most languages you can put more than one instruction on a line and ignore indentation and the code will look exactly the same as the snippet you posted.
>>10,13
All bets are off when it comes to -e. The only virtue here is you can cram it all in. The formatting provided is terrible, but it has nothing on your average IOCCC loser. See >>31.
>>14
You can use either. There's a good reason to use colons though: @list.reduce: {
#comlex multiline recucer function
}
Seeing the likes of ({ ... }) in javascript is so bad and so common I had to change my font.
>>20
It's just bitwise negation, but with arguments explicitly coerced to Int first. It's not too hard to remember, since prefix + explicitly numifies objects and is generally used for numeric context.
>>29 I'm still playing with Rakudo Star, though
You'll be a lot better off in April. A new GC is coming with serious improvements. My tests show it's much faster for real programs and is much better at keeping memory usage low. A program I had which triggered a degenerate case in the old GC consuming ~3 gigs, now seems to level off at about 130MB.
There's also improvements to the object model which will apparently speed up just about everything by a great deal.
>>30
What exactly would you take out? The setting? If so: what do you think is stopping you? Still too much stuff in? Try nqp maybe?
>>33
The one that caused massive memory usage? It was just doing a lot of recursion. It wasn't tail-recursive, and it was not all that well written anyway. I kept it around for benchmarking purposes, since it made such a lovely mess of the GC in a way that shouldn't have been nearly such a problem.
1: my @g = 0, 0;
2: print "0.0";
3: loop {
4: my %set;
5: ++%set{@g[$_] +^ @g[* - $_ - 2]} for 0 .. @g/2 - 1;
6: my $mex = first { !%set.exists($_) }, 0..*;
7: print $mex;
8: push @g, $mex
9: }
I'm just joining this thread.... I've ordered the example in >>10... and i think it's still a little complicated. For example, what happens in line 5 ? I've read the answer about +^ but the @g[* - $_ - 2]} got me. How can you write it in a more C-like way?
Line 6 is too a mystery for me... Is the "first element that ???? in the range 0 .. Infinity" ?
Please perl6 fans, enlighten me.
Cool to see interesting threads like this in /prog/ once in a while
So in line 5 we are doing a lookup on the %set hash and incrementing values:
>my %set = {1 => 1};
1 1
>++%set<1>;
2
>%set
1 2
Line 6 is simple. first takes a block and an array or a sequence and returns the first element from the sequence for which the block evaluates to true:
>first {$_ == 10}, 3..*;
10
>first {$_ % 2 == 0}, 3..*;
4
%set.exists($_) tests if hash has the given key. ! is negation, so first { !%set.exists($_) }, 0..*; means return the first number from the 0..* sequence that is not the key in the %set hash.
Hope it was clear.
Name:
Anonymous2011-02-17 23:41
>>38
To be clearer, $_ is a topical variable, in this case containing each of 0 .. @g/2 - 1 in each pass of the for loop; where @g/2 is half the length of the array.
@g[* - $_ - 2] is an index into @g, $_ elements prior to the second last element (i.e. @g[* - x] counts back from the end of the array), for each $_ in the for list. The code is easy to understand (if you know Perl 6) but slow to follow.
You got the first/.exists stuff right on.
Name:
Anonymous2011-02-20 6:13
Perl 6 fails for being FUCKING BLOATED. It should be a ``small'' core: macros, a way to define operators, some basic data types and some basic operations to use them, classes, junctions, pattern matching and the Perly stuff (regexen, grammars, etc). Then let the user build on top of that core.
There is such Perl. It's called Not Quite Perl: https://github.com/perl6/nqp/