Hybrix is a virtual computer designed so that one person can:
- Learn everything there is to know about the machine
- Create full programs entirely within your web browser
- Understand how each line of code gets compiled into CPU instructions
- Measure speed by counting CPU clock cycles
- Measure memory usage by (in principle) being able to explain the purpose of every byte in your program's address space
Why would you want to? Modern software engineering has so many abstractions and frameworks, it's easy to feel like you'll never fully understand anything, like maybe it's not even possible. Hybrix aims to bring back the experience of working with small systems, while trimming away a lot of complexity. (Complexity that optimizes for electronics cost rather than human mental workload.)
Hardware specs
- 256 KB RAM, up to 1 MB of ROM, 24-bit address bus
- Chombit: a custom 32-bit CPU with only 25 instructions to learn (but multiple forms for each one, so over 200 distinct opcodes)
- Jamdac: a six channel audio chip capable of advanced instruments like drums and guitars, generated from basic arithmetic and DSP buffers
- Palix: a 320x224 graphics chip that renders 1990s-style tilemaps and sprites at 30fps with fixed cycle timings
- No interrupt handlers, threads, or emulator hooks; all device interaction happens through memory-mapped I/O (MMIO)
ROM cartridges are PNG images that steganographically encode up to 64 KB of LZMA compressed bytes. Jamdac chiptunes are executable binaries similar to Commodore 64 .sid files.
Implementation
- The garbage collector and kernel are real Chombit assembly language, without relying on any electronically unrealistic help from the emulator
- Coded in TypeScript without WebAssembly or web workers
- Node.js server with MongoDB running on a self-hosted Debian Linux box
- Minimal third-party dependencies: ANTLR, Monaco, Preact, Day.js, and lzma1
- Six books of online docs (made using Docusaurus)
- I spent 5 years developing it in my free time. Now I'm working on it full time as a commercial product. ($249 one time purchase with a 30-day trial.)
Credits
Other people who helped are listed on the Credits page. The ants in these screenshots (as well as the Chombit Chess art) were made by ZaniPixels.