Ben's Engineering Blog

I recently had a few questions about what led me to building a type checker, so I thought it would be a good idea to put together an overview about things I have built, and the ideas carried along the way.

I got into programming for a few reasons: building ideas and solving logical problems in neat ways is (mostly) fun. Through the process, I have built up an interest in language design and the shortest and fastest ways to put things together.

In 2020, having getting tired of writing a lot of manual DOM operations in JS, I wanted to build abstractions to better write and reuse logic. Rather than going back to using an existing framework, I decided I would write my own framework to get my head around how reactive frameworks work. Around the same type I got into parsing, it started with regular expressions, then onto lexing and recursive descent parsing. During the downtime from the first Coronavirus lockdown, I built a framework/compiler called Prism. I improved my parsing skills up by building a slightly incorrect but working JS, CSS and HTML parser. From the parser ASTs, I built up information about the templates that were used to generate optimized output. I did some experiments involving hydration and SSR. I learnt a bit of rust and got the framework to output views that could be run in Rust.

In 2021, I took my previous experience with parsers in JS and started learning Rust to write a more advanced parser, experimented with Rust multithreading and adding positions where the AST parsed from. After some quick success, I started exploring adding type checking. I put out a final post and update to the Prism compiler and then worked at divriots over the summer building some cool products for the web! (definitely check them out!). After that, took a bit of a break from everything as I had to college again.

In early spring of 2022, I had some thoughts of type level things to do in a compiler. So I then spent my summer break trying to get it all working in the constraints of Rust. I added typed effects, always dependent parameters, an LSP and rewrote a lot of last year's parser and checker code (generics and the representation of types and contexts were overhauled). At the same time, I wrote some posts about Rust and building web things with it for Shuttle. In managed to write a post about the checker and put it out. During the Autumn, back at college, I found some time to add more features, including a REPL and a binary format for the contexts.

In 2023, I open-sourced the parser and checker!