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
Perl6::ObjectSpace in Haskell 0 Comments More | Login | Reply /