Sign In/My Account | View Cart  
advertisement


Listen Print

This Week on Perl 6 (8 - 14 Jul 2002)

by Piers Cawley
July 14, 2002

Perl 6 summary for week ending 20020714

Well, what a week it's been, eh, sportsfans? Without further ado, here's a rundown of all the excitement in the Perl 6 development camps.

Still waiting for Exegesis 5?

The week before last saw a couple of fantastic postings on Perlmonks dealing with the fun stuff in Apocalypse 5. I'm sorry I missed them last week. Damian is still beavering away on the Exegesis, but these (shall I call them Apocrypha?) are worth reading.

http://www.perlmonks.org/index.pl

http://www.perlmonks.org/index.pl

Is Parrot a second system?

John Porter worried about the second-system effect, and about whether the movement to implement a bunch of 'foreign' VM ops on Parrot was just going to add bloat and inefficiency. Dan assured him that ``these 'add-on' bytecode interpreters don't get any special consideration in the core.'' John was reassured.

I think it was decided that Parrot is a second system, but that we're working it to avoid the classic problems associated with it.

http://archive.develooper.com/perl6-internals@perl.org/msg10802.html

Don't mix labels and comments

Simon Glover had a problem with

    A:              # prints "a"
        print "a"
        end

which kills the assembler because of the presence of the comment. Tom Hughes posted a patch to fix it, and Brian Wheeler pointed out that the patch means you can't do print "#", which would be bad. Tom reckons he fixed that with his second patch.

http://archive.develooper.com/perl6-internals@perl.org/msg10915.html Tom's initial fix.

http://archive.develooper.com/perl6-internals@perl.org/msg10918.html And the second.

Perl 6 grammar, take 5

Sean O'Rourke is my hero. He's still beavering away on writing a Perl 6 grammar. The latest incarnation is apparently, ``Turing-complete, if you have a Parrot engine and a bit of spare time.'' The grammar is still incomplete (of course), and someone pointed out that it had a problem with code like { some_function_returning_a_hash() }. Should it give a closure? Or a hash ref. Larry hasn't commented so far.

Sean comments: ``The fact that I've been able to whip this up in a couple thousand lines of code is a remarkable testament to Parrot's maturity, and to the wealth of tools available in Perl 5. In particular, without The Damian's Parse::RecDescent, Melvin Smith's IMCC, and Sarathy's Data::Dumper, it never would have been possible.''

Quote of the thread: ``What, this actually runs? Oh, my.'' -- Dan Sugalski

http://archive.develooper.com/perl6-internals@perl.org/msg10866.html

So, What Is IMCC Then?

I asked, they answered. Apparently, reading TFM would have been a good place to start, though Melvin Smith didn't put it quite so bluntly when he told me. Essentially, the IMCC is the Parrot intermediate language compiler. It's a bit like an assembler but sits at a slightly higher level and worries about the painful things like ``register allocation, low level optimisation, and machine code generation.'' And everyone gets to share that wealth -- Perl6, Ruby, Python, whatever -- they all need the same facilities that IMCC provides.

The idea is that, instead of worrying about registers, you just provide a string of temporaries or named locals, so you can write:

    $I1 = 1
    $I2 = 2
    $I3 = $I1 + $I2
    $I5 = $I3 + 5

And IMCC will notice that it only needs to use two registers when it turns that into:

    set I0, 1
    set I1, 2
    add I0, I0, I1
    add I0, I0, 5

Melvin finishes by saying: `` If people don't get anything else, they should get this. Implementing a compiler will be twice as easy if they target the IR instead of raw Parrot. At a minimum, they implement their parser, generate an AST, and walk the tree, emitting intermediate expressions and directives.''

Leon Brocard, who I am constitutionally required to namecheck in every Perl 6 summary, tells me: ``IMCC is the coolest thing. ... Please don't quote me verbatim.'' Tee hee.

The fine manual is at languages/imcc/README in the Parrot source tree.

Pages: 1, 2, 3

Next Pagearrow