A tiny scheme to x86 asm compiler as described in the paper An Incremental Approach to Compiler Construction by Abdulaziz Ghuloum.
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.
Command line interface for inc
Entry point for the Inc compiler
Core types shared by most of the program
✏ Other notes and documentation
Foreign Function Interface for Inc
Runtime representation of scheme objects
Scheme language transformations & idiosyncrasies
A scheme parser in nom.
Scheme primitives implemented within the compiler.
Scheme runtime for Incremental
A string is a blob of UTF-8 encoded bytes prefixed with the length if it.
A symbol is a blob of UTF-8 encoded bytes prefixed with the length and an unique identifier.
A general purpose x86 library.