6 ms·
Rakudo Star - a useful, usable, "early adopter" distribution of Perl 6
- mstevens 16y agoDownloaded it for a quick experiment. Points I've noticed so far: * It needs perl5 to build. * Hello World still works. * Perl can now compete with Java for slow startup. * One of my pet perl hates, the inability to write "sub foo($a, $b, $c) {" is fixed.
- patrickas 16y ago> One of my pet perl hates, the inability to write "sub foo($a, $b, $c) {" is fixed. I think you're in for a good surprize there, you can even do subset Even of Int where { $_ % 2 == 0 }; sub foo(Even $a) {say $a;} foo(2); # prints 2 foo(3); # Constraint type check failed for parameter '$a'
- someone_here 16y agoI think I'm falling for perl all over again <3
- elblanco 16y agooh God that looks absolutely delicious.
- draegtun 16y agoYep very scrummy! And its also been available (for methods) in Perl5 for a while as well: http://news.ycombinator.com/item?id=1040614 http://news.ycombinator.com/item?id=1040614 Here is the perl6 example using MooseX::Declare (http://search.cpan.org/dist/MooseX-Declare/ http://search.cpan.org/dist/MooseX-Declare/) in perl5: use 5.012; use MooseX::Declare; class Foo { use MooseX::Types -declare => [ qw(Even) ]; use MooseX::Types::Moose qw(Int); BEGIN { subtype Even, as Int, where { $_ % 2 == 0 }; } method bar ( Even $a ) { say $a } } my $foo = Foo->new; $foo->bar( 2 ); # => prints 2 $foo->bar( 3 ); # => throws error
- elblanco 16y agoThis is a cool capability. But I have to admit, it's lacking in the syntactic sugar that made the previous example look so appealing. I just simply read the code out loud in English and immediately knew what it meant. This is a bit more of a tongue twister. This notion of defining subsets of symbols like this could make code correctness for many cases a trivial thing.
- winthrowe 16y agoWell, can you reasonably expect much else? It's a backported feature from perl6, constrained by the existing syntax of perl5. Of course it won't have the syntatic sugar. One of the other cool capabilities of perl6 is the rules system, expanding on regexs so you can work with full on grammars. The perl6 grammar, written in perl6: http://svn.pugscode.org/pugs/src/perl6/STD.pm6 http://svn.pugscode.org/pugs/src/perl6/STD.pm6
- elblanco 16y agoNo, I'm simply stating that I really like what they're doing with Perl 6 so far. I'm excited by the new grammar system immensely. It's clear that doing it in an older syntax is clearly less elegant. However, it's very impressive though that the back ports of Perl 6 features to Perl 5 are proceeding relatively nicely though. The work on Perl 6 has definitely been a boon to 5.
- draegtun 16y agoThe BEGIN { subtype ... } code is just pure perl/Moose. So its possible for the MooseX::Declare developers to add some extra sugar there.
- phaylon 16y agoIt goes away as soon as you put the MooseX::Types declaration into its own package. Which one does pretty often, since reusing types and coercions produces more maintainable code in general. The title of that library isn't "Organise your Moose types in libraries" without reason :)
- kilowatt 16y agoOne of my favorite examples of cool Perl 6 code right now is Perl 6 in Perl 6: http://github.com/masak/yapsi/blob/master/lib/Yapsi.pm http://github.com/masak/yapsi/blob/master/lib/Yapsi.pm
- draegtun 16y agoOne perl6 project that looks very interesting is http://github.com/krunen/xml/ http://github.com/krunen/xml/ XML parser defined using perl6 grammar rules: http://github.com/krunen/xml/blob/master/lib/XML/Grammar/Document.pm http://github.com/krunen/xml/blob/master/lib/XML/Grammar/Doc...
- btilly 16y agoThat pet Perl hate was solved a while ago. See http://search.cpan.org/dist/MooseX-Declare/lib/MooseX/Declare.pm http://search.cpan.org/dist/MooseX-Declare/lib/MooseX/Declar...
- phaylon 16y agoSee also http://search.cpan.org/dist/Function-Parameters http://search.cpan.org/dist/Function-Parameters for plain function signatures and http://search.cpan.org/dist/Method-Signatures-Simple http://search.cpan.org/dist/Method-Signatures-Simple for non-Moose method signatures.
- mstevens 16y agoFunction::Parameters looks like more or less what I was looking for, although I continue to think the perl6 option is a little cleaner.
- chromatic 16y agoPerl can now compete with Java for slow startup. That's my next area of focus for Rakudo optimizations.
- yannk 16y agoI built it two weeks ago and I noticed the slow startup too. I'm pretty sure this will improve. It needs to improve because it matters for shell glue. For the rest of the code I'm writing, startup time is a total non-issue.
- mishmash 16y agoBeen waiting for this release to (re)jump back into Perl development. Congrats to everyone involved!
- Diederich 16y agoThanks so much everyone. Perl 6 has already greatly aided my professional development as excellent features are ported into Perl 5. I don't know what Perl 6's future will be; I have high hopes. But it's already moved me forward.
- kilowatt 16y agoIs there a "Try Perl 6" on the web yet? Google is failing me and I'd love to paste one of the grammar examples into a textbox and start playing it; especially since I don't see Windows binaries linked from the article.
- perlgeek 16y agoThere is one being developed, it will be available at try.rakudo.org. See http://github.com/moritz/try.rakudo.org http://github.com/moritz/try.rakudo.org for the source code.
- prakashk 16y agoNot exactly the most optimal way, but you can hop on to the IRC channel #perl6 and run code there using one of many codebots. Admittedly, you are limited to one-liners here. And, your code will be public, so it's not like running in the "comfort of your own session".
- patrickas 16y agoYou can send private messages to the bot and it will reply to you with the result ... so no problem there. The one liner limitation still apply, but they can be very loooong one liners ;-)
- prakashk 16y agoFor windows binaries, go to http://www.jnthn.net/perl6/rakudo/Rakudo-Star-2010-07.msi http://www.jnthn.net/perl6/rakudo/Rakudo-Star-2010-07.msi, which is where I got it. It may no t be the standard location, so I am not sure how long it will be available.
- ekiru 16y agoThis is now available via the downloads page linked from the announcement, as well.
- draegtun 16y agoSee http://colabv6.dan.co.jp/lleval.html http://colabv6.dan.co.jp/lleval.html which includes perl6 among many other languages. Also its already been updated to Rakudo Star!
- agentultra 16y agoPerl 6 is awesome. Great work guys.
- prakashk 16y agoCongrats and huge thanks for all those involved in this release. It is looking awesome.
- mmaunder 16y agoAs a Perl 5 developer I'm really excited about Perl 6. But the reason I won't use Perl 6 for at least the next 3 years is the same reason Ruby isn't my core language for production apps: I'm waiting for it to get really fast and really stable. Ruby is just about there, so I'll probably switch to Ruby in the next year or so. Then 3 to 6 years from now I'll switch to some incarnation of Perl 6 assuming it maintains its momentum and has tangible benefits over Ruby. I'm not an early adopter. I think startups are risky enough and technology choices are but one point of differentiation in business.
- mst 16y agoI'm happily using MooseX::Declare for when I want better OO - and given Moose is a full metaprotocol with appropriate, extensible objects for everything (ruby has nothing like attributes, let alone extensible meta-attributes, sadly) it's a hugely powerful tool. Piers Cawley happily gave up on ruby and came back to perl5 as a result of it - you should give it a play before looking at a more drastic switch.
- deleted 16y ago[deleted]
- Niten 16y agoThanks to everyone who put this together. This probably sounds silly, but Perl was the first programming language I ever did anything "real" with (it was my second language, after Microsoft QuickBASIC), and no matter how many other languages I try I'll always have a soft spot in my heart for Perl. So it's great to see a real release for Perl 6 which, as it matures, I think will prove itself as the best mainstream dynamic imperative language out there. EDIT: In particular, I think macros and stm will be killer features with respect to other languages, once they're implemented in Rakudo.