Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

Ovid
  (email not shown publicly)
http://publius-ovidius.livejournal.com/
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Wednesday June 25, 2008
08:06 AM

"make perl6" on OS X

[ #36776 ]

If you want to build and run Perl 6 today, you first check out parrot:

svn co https://svn.perl.org/parrot/trunk parrot

A basic incantation for then building Perl 6 would be as follows (doing this from memory, so let me know if I've goofed):

$ cd parrot/
perl Configure.pl && make test
cd languages/perl6
make perl6 && ./perl6 -e 'say "Hello, World!"'

I was getting plenty of strange failures with make perl6 until chromatic pointed out that I likely had a previous parrot installed on my system. Sure enough, a few locates, greps and rms later, I did a make realclean and make perl6 and everything worked beautifully.

And then my very first program failed.

sub fact (Int $n) {
    if 0 == $n {
        return 1;
    }
    else {
        return $n * fact($n - 1);
    }
}

say fact(5);

Even though Perl 6 understands types, I'm told that $n - 1 is returning a Num, not an Int, thus causing a runtime exception. They're working on it.

That being said, I'm quite impressed with how much actually works. If you really want to see more, you can type make spectest_regression and that will check out the tests from Pugs (remember Pugs?) and run them. Lots of them pass and you can search through the tests to see the impressive amount of code which actually works. Perl 6 is coming along nicely. Big shout-outs to chromatic, Patrick Michaud, Jonathan Worthington, Moritz Lenz and far too many other people to list. There is light at the end of the tunnel.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • If "make perl6" fails, try this instead:

    cd languages/perl6/
    make ../../parrot perl6.pbc -e 'say "hi"'

    That doesn't build an executable, just a bytecode file (perl6.pbc). It's not so easy to run, but it works more reliably.

    (The executable is really just as wrapper that links parrot and contains the byte code. Sadly that wrapper isn't very table yet)

    • (The executable is really just as wrapper that links parrot and contains the byte code. Sadly that wrapper isn't very table yet.)

      It's almost exactly the same code as the parrot executable, with two differences. First, it doesn't load external bytecode. Second, it performs a full shutdown of the Parrot interpreter when the process exits.

      The latter occasionally finds memory management errors. I enabled it for that reason -- but these are rare. I've seen (and fixed) one in the past two months.

      Gener

      • If the executable wrapper mostly reveals underlying problems, and doesn't
        cause too many on its own, maybe we should use it for running the tests.

        I already get some memory management failures (at least sometimes) in the
        rakudo tests, it would be a good idea to expose them.

        • If the executable wrapper mostly reveals underlying problems, and doesn't cause too many on its own, maybe we should use it for running the tests.

          Add the --leak-test flag to parrot for the same effect; that option enables the same internal option as the fakecutable.

  • more accurately put, the spectest_regression target runs a subset of the official perl 6 test suite, which is stored in the pugs repository. those tests known to be passing are in the spectest_regression target, so the rakudo implementors can make sure their changes have not broken any existing code.

    the official perl 6 test suite lives under http://svn.pugscode.org/pugs/t/spec/ [pugscode.org]. the pugs repository is a good fit for the official test suite because of the liberal commit policy there. anybody can get a commit

  • … is like this:

    sub fact ( Int $n ) { [*] 1 .. $n }

    ;-)

    (I’ve no idea if that actually works in the current state of Rakudo.)