Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bamboo/idris-codegen-sexp
Idris Simplified Expressions backend
https://github.com/bamboo/idris-codegen-sexp
compiler idris idris-ecosystem
Last synced: 18 days ago
JSON representation
Idris Simplified Expressions backend
- Host: GitHub
- URL: https://github.com/bamboo/idris-codegen-sexp
- Owner: bamboo
- License: other
- Created: 2018-02-17T17:51:22.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-17T17:51:59.000Z (almost 7 years ago)
- Last Synced: 2024-10-28T19:57:38.231Z (2 months ago)
- Topics: compiler, idris, idris-ecosystem
- Language: Haskell
- Size: 5.86 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# idris-codegen-sexp
An [Idris](https://www.idris-lang.org/) backend that outputs pretty printed [Idris simplified
expressions](https://github.com/idris-lang/Idris-dev/blob/f92ecd25d48a9120abfbb7d6af81f9b194ab98f1/src/IRTS/Simplified.hs#L3), useful for backend writers.```idris
main : IO
main = putStrLn "Hello World!"
```Becomes:
```idris
(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