Viscosity's internals, and how to learn compiler engineering from scratch
Having found no project doing something which I expected to be deterministically possible, I created Viscosity, the world’s first automatic, ahead-of-time Array of Structures to Structures of Arrays compiler for any language, starting with JavaScript and TypeScript, with more languages to come. However, I didn’t just want to create documentation. I wanted others to be able to learn how to create something like this, regardless of their engineering background.
As such, I wrote a book with the help of Opus 5.5 (2026 frontier LLMs are great for writing technical documentation, no surprise given the training corpus, and given that programming is uniquely suited to reinforcement learning with verifiable rewards) to take someone who has beginner-level programming experience, or is already an expert engineer (it doesn’t matter), to being able to write their own programming language, a compiler, and Viscosity itself. Additionally, I have you do it in TypeScript first (which is taught) and then again in Rust (which is also taught), in the spirit of how Robert Nystrom wrote Crafting Interpreters (an excellent book which I wish I had found when I took my compilers class in undergrad, where I had to read a theoretical compiler book to tease out the implementation details).
Given that AI is rapidly extending the capabilities of us engineers, I didn’t want to just create Viscosity, but rather a community that learns from each other, with this book being a start.
Additionally, while you may command and direct LLMs and their agentic harnesses to do things for you, never outsource your understanding and your reasoning; the knowledge you gain will help you connect dots years from now.
After you read this book, I believe you will be able to make meaningful contributions to Viscosity and make software faster for humanity (and hopefully enjoy the journey as well).