There are many different partial implementations of Perl 6; at the moment, the most complete is Rakudo. There are a number of different ways to get it up and running, but if you have any interest in tracking or helping with the development, the best approach is to download directly from the source repositories and and build your own copy.
To do so, you will need Subversion (svn), git, Perl 5.8 or newer, a C compiler, and a make utility. On standard Linux-like systems (including OS X), you can build it like this:
$ git clone git://github.com/rakudo/rakudo.git $ cd rakudo $ perl Configure.pl --gen-parrot $ make $ make test $ make install
Subversion is needed to run –gen-parrot — it actually uses svn to get the appropriate version of parrot and then compile it. You will need to use the appropriate make command for your system. (It’s generally nmake with MS Visual C++, I believe.)
For current Rakudo, make install doesn’t install into your path, it merely preps the system so that you can run the perl6 executable (created in the rakudo directory) from any other directory on your system. Once you have it going, you can easily play around with Perl 6 by executing perl6 with no arguments, putting you into a REPL environment where you can type commands and see what they do. This can be incredibly handy for trying to figure out how Perl 6 works. For instance,
$ ./perl6
> say "Hello world!";
Hello world!
> say (10/7).WHAT
Rat()
> say [+] (1..999).grep( { $_ % 3 == 0 || $_ % 5 == 0 } );
233168
The lines starting with $ and > are what you type; the other lines are Rakudo’s response. The first example is a simple say statement. The second creates a rational number and asks WHAT its type is (Rat). The third takes the list of numbers from 1 to 999, filters out the ones not divisible by 3 or 5, sums them, and then says the result. (This is Project Euler Problem #1, thanks to draegtun for reminding me of it.) We’ll try to explain how these things work in a future post.
One last thing. If you have any difficulties getting Rakudo working, the #perl6 channel on irc.freenode.net is usually very helpful.
December 1, 2009 at 10:06 pm |
Hi guys! Thanks for this first entry. Finally I got Rakudo installed and it was so simple! Looking forward to the following entrys.
December 1, 2009 at 10:41 pm |
Hi. Sorry to be a buzz-kill, but what gets installed where? Am I putting unmanaged files on my system? Do I need admin/root authority? Does it just go into my home directory somewhere? I’m just an organizational fascist. I really like package management and like to keep unmanaged files contained or otherwise organized. If there’s a readme I can look at after the clone to figure out how to tweak that process, that’s good enough.
Thanks
Edd
December 1, 2009 at 10:45 pm |
Hi Edward,
when you run ‘perl Configure –gen-parrot’, parrot is installed into the parrot_install directory below your rakudo directory. Running ‘make install’ installs into the same dir, so the binary ends up in parrot_install/bin/perl6. No root privs required.
See also: http://rakudo.org/how-to-get-rakudo and http://github.com/rakudo/rakudo/blob/master/README
December 2, 2009 at 1:02 am |
How do you make the REPL print the evaluated expression by default, so you don’t need to type “say”?
December 2, 2009 at 9:20 am |
Ben: The P part of the REPL isn’t implemented yet :(
Rakudo is having a major refactor in a branch right now, and hopes are that we can implement it in that branch rather soon, so I’ll expect it either for December or January release.
December 3, 2009 at 2:47 am |
During ‘make test’ I hit an error. Where should I go to follow up? I’m guessing irc? I’ll post the error below. Everything else came up ok.
Thanks,
Edd
.
.
.
t/01-sanity/07-simple-multisubs….ok
t/01-sanity/07-split……………Null PMC access in i_bitwise_shl_int()
in Main (file , line )
t/01-sanity/07-split……………dubious
Test returned status 1 (wstat 256, 0×100)
t/01-sanity/07-substr…………..ok
.
.
.
Failed Test Stat Wstat Total Fail List of Failed
——————————————————————————-
t/01-sanity/07-split.t 1 256 ?? ?? ??
2 subtests skipped.
Failed 1/29 test scripts. 0/232 subtests failed.
Files=29, Tests=232, 51 wallclock secs (42.32 cusr + 3.79 csys = 46.11 CPU)
Failed 1/29 test programs. 0/232 subtests failed.
make: *** [coretest] Error 255
December 3, 2009 at 2:57 am |
Eddward: Yes, IRC is the best place to discuss this. In the meantime, what platform? You can also run
make t/01-sanity/07-split.t
which should run it again and detail the individual successes and failures.
December 6, 2009 at 8:25 pm |
[...] featuring one cool Perl 6 feature every day until Christmas. Topics currently covered include how to get and build Rakudo (the most actively developed and progressed implementation of Perl 6) and the new Metaoperators. [...]
December 7, 2009 at 10:31 pm |
[...] декабря в рамках цикла статей было рассказано обустановке Rakudo, использованию циклов, операторах [...]
December 8, 2009 at 5:25 pm |
[...] я и планировал, выкладываю перевод первой статьи цикла Perl 6 Advent Calendar. Напоминаю, что перевод [...]
January 3, 2010 at 11:33 am |
Maybe a little bit late — for those of you who run Fedora; thanks to Gerd, rakudo is in repository, just run “yum -y install rakudo” as root to install it!
April 24, 2010 at 3:14 pm |
I just wanted you to know this is now my favorite web site. You guys rock!
September 27, 2011 at 3:09 pm |
[...] By colomon: http://perl6advent.wordpress.com/2009/12/01/day-1-getting-rakudo/ [...]