-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
50 lines (32 loc) · 1.22 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Another Scheme Compiler
Still in early development!
Current design
==============
* CPS high-level IR
Raw scheme source code undergoes macro expansion, alpha conversion,
CPS conversion, beta reduction, closure conversion, and finally,
conversion to the Tree IR.
* Tree-based low-level IR
Used as a convenient source IR for instruction selection.
* x86-64 instruction selector
Uses a near-optimal maximal munch algorithm, and a set of pattern-matching rules.
* Linear scan register allocator
After computing live ranges for temps, we allocate registers in a single
pass over the machine instructions. The allocator is able to temps which
are pre-assigned a specific hardware register (due to calling conventions, etc)
* Assembler [TODO]
Written in Scheme!
Supported Language
==================
Primitives: lambda, let, begin, if, and, or, not, fx+, fx-, fx=, fx<=, fx>=, fx<, fx>
Data: closures, fixnums
Build
=====
Dependencies: Chicken Scheme
$ make
Usage
=====
Currently the `scc' executable takes an input file containing a Scheme program, and dumps the generated x86-64 assembly to standard out. Early days!
$ scc FILE
Example: Scheme program which calculates fibonacci(23)
$ scc tests/fibonacci-001.scm