Ram Maheshwari Logo Image
Yared Fikremariam

Scheme Compiler

A compiler and interpreter that translates and runs a high-level functional language, a subset of Scheme, to x86-64 assembly with a C runtime system.

Project Image

Project Overview

An all in one compiler and Interpreter that takes in a given Racket/Scheme expression, converts it to a list of tokens that will then be parsed to produce an abstract symbol tree,i.e AST, that can be interpreted in the Racket runtime or can be translated to x86-64 instruction set architecture and run using the C runtime.

It supports a subset of scheme including Primitives, Local Variables, Nested Binary Operations, Booleans, Branches and Dynamic Types ,Functions, Tuples and Structures, & Lambdas and closures.

Features

- Primitives, vectors, strings, variadic operations & syntax checking
- Inductively defined data types with cons and box
- Pattern matching
- Conditionals & Dispatch Evaluation with Cond and Case statements
- Binding for arbitrary number of expressions with let statements
- Functions with arity-checking, rest arguments, arity-based dispatch, and tail call support
- Lambda statements and Multiple returns

Tools Used

Racket
x86 Assembly
C