[kw-pm] Perl 6 Watch - Pugs and S29

Eric - fishbot eric at uc.org
Wed Apr 6 10:34:33 PDT 2005


I thought that as KWPM Unofficial Perl 6 watcher, I would provide
a bit of an update.  Of the things I think are cool, but might
have slipped past the gaze of the casual P6 observer.


Pugs
-----------------
Overview of Pug Project:
http://svn.perl.org/perl6/pugs/trunk/docs/01Overview.html

Pugs is a Perl6 implementation in GHC Haskell.  Apparently
Haskell is particularly suited to Perl6 work for its native
laziness and continuations.  This allowed the system to be
prototyped in a week, and a base implementation was released
inside a month.

The intent with Pug appears to be more along the lines of
language prototyping and ironing out syntax and structural issues
with the language itself, independent of Parrot... but not to
supplant Parrot.

Interestingly, (I think) Parrot and Pugs are currently excelling
in non-overlapping areas:

 - Parrot's low level operations are very fast and optimised -
   but you currently cannot compile Perl6 to Parrot bytecode
 - Pugs has fair and rapidly extending coverage of Perl6, and is
   able to compile it quickly to bytecode... but the resulting
   bytecode is apparently quite slow.  (100x slower than Perl5)

Pugs project leader Autrijus Tang is planning to attend YAPC::NA
in Toronto, and possibly hang around afterwards for a Pugs
hacking session with those interested.  If anyone is interested,
please let me know... I am considering connecting with this on
some level, if only in the docs or testing realm.  YAPC is June
27-29, 2005 -- so if there are interested people, I could
envision finding time to convene a Pugs primer hacking session.


S29 - Draft
--------------------
Rod Adams has started piecing together a spec that corresponds to
Chapter 29 in the Camel Book - Native Functions/Operators.  A lot
of things have been suggested for Perl 6 in a lot of different
context (ie. chop() dies, each() survives, reduce{}() is born)...
but little bits in different places is slowing down the Pugs
team.

The Draft is here for now:
http://www.rodadams.net/Perl/S29.html

He is documenting how he believes the multi sub/method signatures
would be declared... and in some cases providing implementations:

 multi sub pop () returns Scalar {
   pop @CALLER::_;
 }
 &pop<Array> := &splice<Array>.assuming(:offset(-1) :length(1));

The pop() is my favourite example so far.  In those three fairly
simple lines we get a look at the power and flexibility of the
new dispatch structure.  We see an explicit wrapper for the
null-arg variant of pop, which calls the array-arg variant after
grabbing the caller's @_.

Then the the array-arg variant is declared as a wrapper using a
straight bind to splice, using the cool .assuming method of
closures/subs/methods to create wrapper references.

It looks like he is a little under halfway through... if you
discount IPC functions and system functions, which remain pretty
hazy at this time.  Larry hasn't weighed in on IPC yet... I can't
decide if that is because something very cool is coming, or
because it will end up being simply a fairly vanilla core module
with no deep magic.

That's all for this iteration.  See everyone on the 28th!

fishbot
:wq


More information about the kw-pm mailing list