fools-pyrite

computer toucher; RPG enjoyer


over the long weekend I found myself wanting a big hobby project I can sink my teeth into, now that I'm not GM'ing any RPG campaigns. While on a walk, I decided it would be a new programming language. So far it’s coming along surprisingly well!


My previous attempts at writing compilers have been focused on nailing down each component: write the entire lexer, then write the entire parser, then the semantics, etc. This usually peters out with a decent parser and pretty much nothing else implemented, because it's easy to lose interest at this stage. To combat this problem I'm writing the current compiler end-to-end; when I want to add a new feature, I make any necessary changes to the lexer, the parser, the semantic analyzer, and the backend (in that order). Then I can immediately write a new tiny program that uses the feature, and test the compiler end-to-end.

I'll probably open-source my work soon (because I think it's a fun project), but I doubt it will go beyond toy usage. My current plan is pretty inspired by Saiorse / Boats's Notes on a Smaller Rust; I'm trying to build a simple, Rust-inspired imperative language that targets WASM. Thus far I have addition, numeric comparison, variable declaration & assignment, if statements, and while loops.

Side note: If you are at all interested in programming languages & compilers, I cannot recommend enough @munificient's Crafting Interpeters. It's one of the only good compiler books that I've read (including the famous "dragon book").


You must log in to comment.