Skip to content
A Scheme Compiler
Scheme
Find file
Pull request Compare This branch is 9 commits ahead of master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
arch/x86-64
docs
tests
.gitignore
Makefile
README
arch-syntax.scm
arch.scm
fast-match-syntax.scm
globals.scm
helpers.scm
hil-syntax.scm
liveness.scm
machine.scm
main.scm
munch-syntax.scm
pass.scm
struct-syntax.scm
tree.scm

README

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



Something went wrong with that request. Please try again.