Day 136: Ninth day in Leo's: Prelude to PIR

autrijus on 2005-06-20T01:25:46

Thanks to iblech and putter, we now have a beginning of Prelude::PIR, a set of built-in Perl 6 functions implemented in Perl 6 for Parrot. I expect these, along with other primitives implemented in PIR, to be compiled to bytecode eventually.

After days of hacking, chromatic finally conquered Pugs's parameter binding to implement submethod BUILD (+$.x, +$:y) that works with .new calls. The next step toward OO nirvana is probably class variables (my $foo and our $foo inside a class declaration), which should make sri much happier.

Other progress on the PIR front:

  • The &infix_postfix_meta_operator:<=> now works: $x += 3
  • Basic support for arrays: my @a = 1..10; @a[5]=100; say join ",", @a
  • &infix:=< constructs a Pair object.
  • pugs -C no longer create the misleading dump.ast file -- the compiled code is now simply piped to stdout.
  • Trivial support for explicit tail calls via &sub.goto().
  • Lots and lots of primitives filled in.

Most of my time today are spent on sleeping -- the last week has stressed me out a bit -- as well as reading papers and other people's implementations. Of particular interest to me is the CLR family of languages -- Nemerle, Mondrian, F#, Boo, etc. Of those, Nemerle is especially interesting; like Perl 6, it is designed around metaprogramming, parametric polymorphism, good ML-style functional programming primitives, and a nice OO core.

Chasing the bibliographies from Erik Meijer of Mondrian fame, I have found some nice algorithms for codegen to register-based machines ; Dan's arguments for a register-based design and Leo's arguments for variable-sized frames all makes much more sense to me now. If AbsIL has a free Haskell counterpart, or if its F# library can interperate with Mono, I'd seriously consider working on Emit.IL for CLR too...

Anyway, I need to sleep now. Hopefully tomorrow I'll have enough time to roll a release. Then I'll fly to Toronto and participate in the next Hackathon -- will keep you posted.


F# on Mono

johnseq on 2005-06-20T11:18:15

this post implies that it can ...

http://lambda-the-ultimate.org/node/view/323

Also, have the dotgnu folks done any IL AST work that might be useful? (treecc etc?)

Perl6 -> IL would be pretty cool.