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 ]

autrijus (1505)

autrijus
  (email not shown publicly)
http://pugs.blogs.com/

Journal of autrijus (1505)

Saturday August 13, 2005
02:39 PM

Day 188 (r6230): Perl 6 compiled to Perl 5 data structures.

[ #26268 ]
This may not be exciting as compiling Perl 6 into Perl 5 programs, but it's exciting news nevertheless. With help from the amazingly flexible DrIFT, pugs -CPerl5 can now serialize the compiled PIL1 tree into a Perl 5 expression:

% ./pugs -CPerl5 -e "say 42"
bless({
    pilMain => bless({
        pStmt => 'PNoop',
        pStmts => bless({
            pStmt => bless({
                pPos => bless({
                    posName => "-e",
                    posBeginLine => 1,
                    posBeginColumn => 1,
                    posEndLine => 1,
                    posEndColumn => 7
                } => 'MkPos'),
                pExp => (undef),
                pNode => bless({
                    pExpr => bless({
                        pLV => bless({
                            pCxt => bless(['TCxtVoid'] => 'TTailCall'),
                            pFun => bless({
                                pLV => bless({
                                    pVarName => "&say"
                                } => 'PVar')
                            } => 'PExp'),
                            pInv => (undef),
                            pArgs => [
                                bless({
                                    pLit => bless({
                                        pVal => bless([42] => 'VInt')
                                    } => 'PVal')
                                } => 'PLit')
                            ]
                        } => 'PApp')
                    } => 'PExp')
                } => 'PStmt')
            } => 'PPos'),
            pStmts => 'PNil'
        } => 'PStmts')
    } => 'PStmts'),
    pilGlob => [
        bless({
            pSubName => "&*END",
            pSubType => "SubPrim",
            pSubParams => [],
            pSubBody => 'PNil'
        } => 'PSub')
    ]
} => 'PIL::Environment')

iblech expects PIL2JS compilation to be several times faster, once he switches it to use this representation. Furthermore, as the derive Perl5 works for any Haskell data type, we can load in PIL2 and their support structure in Perl 5 with no extra effort, which will greatly simplify the true Perl6-on-perl5 effort.

Tomorrow I'd like to work on -CYAML, -CXML and/or -CBinary, just to make sure that everybody can play with Pugs's internal structures, so we can have macros and refactoring browsers written in non-Haskell languages.

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.