https://github.com/keyz/p423-compiler
A Scheme to x86-64 compiler in Scheme
https://github.com/keyz/p423-compiler
Last synced: 7 months ago
JSON representation
A Scheme to x86-64 compiler in Scheme
- Host: GitHub
- URL: https://github.com/keyz/p423-compiler
- Owner: keyz
- Created: 2015-03-09T19:18:42.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-05-04T03:36:37.000Z (about 11 years ago)
- Last Synced: 2025-03-24T02:52:54.922Z (over 1 year ago)
- Language: Scheme
- Homepage:
- Size: 484 KB
- Stars: 78
- Watchers: 5
- Forks: 47
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# p423-compiler
Archive repo of a Scheme to x86-64 compiler in Scheme.
Supports:
- closures
- first-class procedures
- side effects with `set!`
- closure conversion, tail-call elimination, branch predication, constant folding, dead-code elimination, and... several other optimizations
The supported BNF is listed as below.
```
Program ::= Expr
Expr ::= Constant
| Var
| (quote Datum)
| (if Expr Expr)
| (if Expr Expr Expr)
| (and Expr *)
| (or Expr *)
| (begin Expr * Expr)
| (lambda (Var *) Expr +)
| (let ([Var Expr] *) Expr +)
| (letrec ([Var Expr] *) Expr +)
| (set! Var Expr)
| (prim Expr *)
| (Expr Expr *)
Datum ::= Constant | (Datum *) | #(Datum *)
Constant ::= fixnum | () | #t | #f
Var ::= an arbitrary symbol
```
For more information, please refer to the [course page](http://homes.soic.indiana.edu/classes/spring2015/csci/p423-rrnewton/) of CSCI-P 423 at Indiana University. Unless otherwise specified, I only own the files under [`Compiler`](https://github.com/keyanzhang/p423-compiler/tree/master/Compiler).