Compiler Design Documents

This folder contains design documents and other musings created as part of the development of Feersum. The documents aren’t guaranteed to be up to date, accurate, or even useful.

Syntax Trees

The syntax trees used in the parsing stage in Feersum are based on the idea of Red / Green trees. Low level green nodes contain no position information. Higher level red nodes add ofsets and parent pointers to provide the full concrete syntax tree. We then provide a third layer built on top of this red tree in the Feersum.Syntax.Tree module. Each node in this tree provides a typed, lazy, and fault-tolerant view over the underlying tree.

For move information about the underlying syntax trees, as well as a discussion about the implementation in Firethorn, the library that Feersum uses, check out this blog post.

Document Service

This document outlines an improved approach to source locations, provenance, and text document handling. The aim is to introduce a DocumentService which manages interactions with source documents. It provides a means to load both real and synthetic documents and parse them into syntax trees.

Syntactic Closures Expansion and Binding

This document records the consolidated macro and binding design that Feersum now implements. It supersedes the earlier split documents that separately described work-stack expansion and binder-context restructuring.

Last updated: 2026-05-02