Running a interpreter in WASM
Do not try this at home.
This uses HeavyImp, which is an interpreter in Rust for a simple imperative language with pointers, written for a Programming Languages class. This interpreter can report two types of errors: parsing and type-checking errors. Errors would not be possible while actually running the program, as the type-checker would have already caught them.
To use this Rust project in the browser, I used wasm-pack, to create an npm package that can be imported into the project. Some (a lot) changes were necessary in the wasm-refactor
branch to get this working, as well as a lot of wrangling with Next.js and Webpack.
Here's also probably a good place to shout out MDX, for making it so much nicer to write posts, with React components right in the middle of a markdown document. It was the only thing that didn't let me down when trying to get this working.