[−][src]Crate inc
An Incremental scheme compiler
A tiny scheme to x86 asm compiler as described in the paper An Incremental Approach to Compiler Construction by Abdulaziz Ghuloum.
Where do I get started? 🕵️♀️
Read the first few sections of the paper to understand the premise.
There is a mix of Scheme, C, Rust and x86 assembly here and these are some good places to start learning them.
- x86 module documentation contains links to a few good x86/assembly tutorials.
- How to C in 2016 is a pretty good C refresher.
- The Rust Programming language book is a good place to start learning rust.
Compile the project and run a few sample programs (see README.md or tests) before diving deep into the code.
The core module contains the main data types used by the compiler and is a good place to start reading the code. parser implements a scheme parser using nom can be understood independently from the rest of the project. immediate documents the runtime representation of the scheme objects. rt and ffi describe the runtime nuances like memory management while lang implements language level semantics like functions and variables.
See docs for some additional notes and comments.
Modules
cli | Command line interface for inc |
compiler | Entry point for the Inc compiler |
core | Core types shared by most of the program |
docs | ✏ Other notes and documentation |
ffi | Foreign Function Interface for Inc |
immediate | Runtime representation of scheme objects |
lambda | Scheme functions |
lang | Scheme language transformations & idiosyncrasies |
parser | A scheme parser in nom. |
primitives | Scheme primitives implemented within the compiler. |
rt | Scheme runtime for Incremental |
strings | A string is a blob of UTF-8 encoded bytes prefixed with the length if it. |
symbols | A symbol is a blob of UTF-8 encoded bytes prefixed with the length and an unique identifier. |
x86 | A general purpose x86 library. |