Skip to content

bamboo/idris-codegen-sexp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

idris-codegen-sexp

An Idris backend that outputs pretty printed Idris simplified expressions, useful for backend writers.

main : IO
main = putStrLn "Hello World!"

Becomes:

(SFun "runMain0"
      []
      1
      (SLet (Loc 0)
            (SLet (Loc 0)
                  SNothing
                  (SApp False "Main.main" [(Loc 0)]))
            (SApp True "EVAL0" [(Loc 0)])))


(SFun "Main.main"
      ["in0"]
      1
      (SLet (Loc 1)
            (SLet (Loc 1)
                  (SConst (Str ['H','e','l','l','o',',',' ','w',
                                'o','r','l','d','!','
                                ']))
                  (SOp LWriteStr [(Loc 0),(Loc 1)]))
            (SCon Nothing 0 "MkUnit" [])))


(SFun "EVAL0"
      ["arg0"]
      1
      (SChkCase (Loc 0)
                [(SDefaultCase (SV (Loc 0)))]))

Installation

stack install

Usage

idris --codegen sexp test/cases/HelloWorld.idr -o HelloWorld.sexp

About

Idris Simplified Expressions backend

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published