Changeset 7843 for src/Pugs/CodeGen.hs

Show
Ignore:
Timestamp:
11/05/05 11:41:57 (3 years ago)
Author:
autrijus
Message:

[Massive backport from svn.perl.org now openfoundry is back]

* theorbtwo notes that FIRST {} blocks did not

desugar into anything that passes PIL compilation,
as it's useing a Stmt in LValue position.
Fixed by desugaring using ternary if.

* Squash an empty import warning for precompiled preludes.

* Support for "./pugs -C PIL2".

Currently, "-C PIL" and "-C PIL1" both maps to PIL1,
but some day "-C PIL" may change to PIL2.

* Repo copy Pugs.CodeGen?.PIL to Pugs.CodeGen?.PIL2
* Also rename CodeGen?.PIL to CodeGen?.PIL1

* Add DrIFT-generated source of PIL2.hs.

* Repo copy PIL1 to PIL2 for the long-much-overdue PIL2

refactoring. The goals are:

  • Compile time object serialization
  • Lexical hoisting
  • Static creation of Code objects with scope (no PSub forms)
  • Full Cxt information
  • PIL2 is *after* type erasure -- *no* static type annotation should be left after that -- it's somewhere between F<: and ANF, so to speak.

* Adds support for "./pugs -BPugs -e ...", which just takes

-CPugs output and feed to the "runghc" executable in PATH.

* pugscc: chase the s/MainCC.mainCC/Main.main/ change

as the now-cabalized Pugs package no longer exports "main".

* Compile-time objects now survives "./pugs -CPugs" compilation.

This means the line below works now:

pugscc -e 'class F {}; my $x ::= F.new; say $x'

Previously, the ::= would prevent compilation because we
did not have a serialization protocol for VObject types.
(This work is going to be carried over to PIL.)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/CodeGen.hs

    r7127 r7843  
    1313import Pugs.AST 
    1414import Pugs.Internals 
    15 import Pugs.CodeGen.PIL (genPIL) 
     15import Pugs.CodeGen.PIL1 (genPIL1) 
     16import Pugs.CodeGen.PIL2 (genPIL2) 
    1617import Pugs.CodeGen.PIR (genPIR) 
    1718import Pugs.CodeGen.Perl5 (genPerl5) 
     
    2021import Pugs.Compile.Pugs (genPugs) 
    2122import Pugs.Compile.Haskell (genGHC) 
    22 -- import Pugs.CodeGen.PIL2 (genPIL2) 
    2323-- import Pugs.CodeGen.XML (genXML) 
    2424import qualified Data.Map as Map 
     
    3131    , ("Parrot",      genPIR) 
    3232    , ("PIR",         genPIR) 
    33     , ("PIL",         genPIL) 
    34 --  , ("PIL2",        genPIL2) 
     33    , ("PIL1",        genPIL1) 
     34    , ("PIL2",        genPIL2) 
    3535    , ("Perl5",       genPerl5) 
    3636    , ("Pugs",        genPugs) 
     
    4949    norm' "parrot" = "Parrot" 
    5050    norm' "pir"    = "PIR" 
    51     norm' "pil"    = "PIL" 
    52     -- norm' "pil2"   = "PIL2" 
     51    norm' "pil"    = "PIL1" -- XXX - this will change 
     52    norm' "pil1"   = "PIL1" 
     53    norm' "pil2"   = "PIL2" 
    5354    norm' "perl5"  = "Perl5" 
    5455    norm' "pugs"   = "Pugs"