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 ]

Journal of Stevan (6065)

Wednesday December 14, 2005
08:24 PM

Perl6::ObjectSpace in Haskell

[ #27993 ]

Audrey recently began the process of porting the Perl6::ObjectSpace to Haskell to eventually become the new Pugs runcore. After creating the core (native) types in Haskell, audrey promptly implemented a mini-language using these types. It looks (of course) a lot like a very limited subset of Perl 6, but since we lambdacamels like our purity, it is side-effect free. Here is an example of a factorial function which uses a fixed point combinator to get around the fact we cannot call functions by name.

(-> $n {
    (-> &fact {
        &fact.(&fact, $n)
    }).(-> &f, $x {
            $x.eq(0).cond(
                -> { 1 },
                -> { $x.multiply( &f.(&f, $x.subtract(1)) ) }
            )
       });
}).(10);

The real purpose of this mini-language is to script the core runtime types to bootstrap the Perl 6 MetaModel. Today I commited the skeleton of the MetaModel Bootstrap PIL to Pugs. These are the first steps towards Pugs 6.28.0 and a fully realized Perl 6 object model in pugs.

- Stevan

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.