July 8th, 2024

Ur-Scheme: A GPL self-hosting compiler from a subset of R5RS Scheme

Ur-Scheme is a compact GPL compiler translating R5RS Scheme to Linux x86 assembly. Despite limitations, it offers speed, safety, and unique extensions. Inspired by Ghuloum, it simplifies compiler construction.

Read original articleLink Icon
Ur-Scheme: A GPL self-hosting compiler from a subset of R5RS Scheme

Ur-Scheme is a GPL self-hosting compiler that translates a subset of R5RS Scheme into fast Linux x86 assembly language. Despite its limitations, such as missing features and impracticality beyond basic functionality, it offers reasonable speed and safety. The compiler is small, portable, unit-tested, and comes with extensions not found in R5RS. Inspired by Abdulaziz Ghuloum's approach to compiler construction, the developer aimed to simplify the process and provide a learning tool. The compiler's origins lie in a project to bootstrap a metacompiler for Bicicleta, highlighting lessons learned about interpreters, compiler complexity, and starting with simple solutions. Despite bugs like unbuffered output and lack of a garbage collector, Ur-Scheme stands as a testament to creating a functional compiler in a compact form.

Link Icon 0 comments