Three more backends joined Pugs today:
- "./pugs -CPIL1-YAML" dumps the PIL1 tree using gaal's Syck emitter binding.
- "./pugs -CPIR-YAML" serializes the PIR syntax tree generated from PIL1.
- "./pugs -CParse-YAML" does the same for the parse tree itself, upon theorbtwo's request.
They are made possible thanks to the DrIFT technology. It lets us specify how to convert any Haskell structure into YAML nodes, with a simple rule file and some base instances. From there on, say if we'd like to add various serialization for PILN native types, all it takes is a single pseudo-comment in the .hs-drift file:
{-! global : YAML, Perl5, JSON, HaskellXml, ... !-}
Debugging PIL1, PIR and the parse tree is made much simpler with this effective visualization tool. I've also released a new YAML::Syck that can load Haskell structures into blessed Perl5 objects, although Ingy's YAML.pm 0.50 also does this in a more elegant fashion, without involving Class::Rebless.
Loading from YAML to arbitrary Haskell structures should also be straightforward; now we just need a Syck emitter binding at Parrot's side, and we can shuffle Parrot objects (e.g. PGE Match objects or TGE trees) with Pugs's compiler backend across separate compilation units. That should be fun...
Comments