Catalyst is a self-hosted Open Smalltalk virtual machine and object memory, written in Smalltalk and decompiled to WASM GC for operation in web browsers. It uses AI-assisted dynamic method translation to optimize high-frequency code paths. Each Catalyst module can run multiple concurrent systems, and uses this ability to provide continuity of operation across class type changes. Catalyst leverages JavaScript for finalization and host device driver access, and uses SqueakJS as an environment for simulation, debugging, and deployment.
- Runtime Bytecode-to-WASM Translation: Translates Smalltalk bytecodes to WebAssembly Text (WAT) format at runtime
- Hot Method Detection: Automatically identifies frequently-executed methods for translation
- AI-Assisted Optimization: Uses LLM integration for intelligent method translation
- Performance Monitoring: Tracks method translation activity and performance metrics
- Debug Support: Detailed logging and single-step debugging capabilities
- Open Smalltalk Compatibility: Maintains compatibility with Open Smalltalk architecture
- Multi-System Support: Each Catalyst module can run multiple concurrent systems
Catalyst uses a hybrid approach where methods start as interpreted bytecode and get translated to optimized WASM when they become "hot" (frequently executed). This provides the flexibility of interpretation with the performance of compiled code.
Read more at the thisContext blog.
I've been experimenting with AI coding assistance to accelerate Catalyst's development, and found it very productive. I'm currently using Kiro, and prefer it to alternatives such as Cursor, Windsurf, Claude Code, Claude Projects, and ChatGPT projects, primarily because of its approach to specification-driven development. This repo has several documents that make AI-assisted development more productive, including AGENTS.md and the steering documents in .kiro/.
- Kiro: AI-assisted IDE (optional)
- Node.js 16+: Build system and development server, to be replaced by SqueakJS in the future
- wasm-tools: WASM toolchain for analysis (optional)
- wasm-opt: WASM optimization (optional)
# Install wasm-tools
cargo install wasm-tools
# OR
brew install wasm-tools
# Install dependencies
npm install# Build the project (compiles WAT to WASM)
node build.js
# Start with LLM integration
node start-with-llm.jsOpen your browser to http://localhost:8000/test.html to benchmark the VM.
catalyst/
├── catalyst.wat # Main WASM source code (WebAssembly Text format)
├── catalyst.js # JavaScript VM interface and method translation engine
├── catalyst.wasm # Compiled WASM binary (generated)
├── build.js # Main build script
├── test.html # Interactive test page
├── serve-coi.js # Development server with Cross-Origin-Isolation
├── api-proxy.js # Proxy server for LLM API integration
└── dist/ # Build output directory
The build system (build.js) performs:
- Compiles
catalyst.wattocatalyst.wasmusingwasm-tools parse - Copies JavaScript files to
dist/ - Generates WASM module analysis dump
- Updates package metadata with build timestamp
Eventually, SqueakJS will do all of this; catalyst.js currently does LLM prompting, WAT-to-WASM compilation, and caching of WASM functions in the Catalyst method cache.
Handwritten interpreter supporting single method evaluation (3 + 4)
Message sending support with (3 benchmark) - actual message dispatch
instead of just bytecode execution
Method Translation Foundation Complete
- Runtime bytecode-to-WASM translation
- Hot method detection and polymorphic inline caching
- Performance comparison between interpretation, naïve translation, and LLM translation
Generate interpreter by decompiling equivalent Smalltalk implementation using Epigram compilation framework
- Object memory snapshots and transfer between VMs
- Sista instruction set support
- Enhanced adaptive optimization
- Naiad module system support
- Compatibility with Squeak, Pharo, and Cuis object memories
- Manual testing via
test.htmlin browser, via SqueakJS in the future. - Performance benchmarks compare interpretation vs. translated methods
The project requires Cross-Origin-Isolation headers for WASM GC and SharedArrayBuffer support:
- Development server (
serve-coi.js) automatically sets required headers .htaccessconfiguration provided for Apache deployment.well-known/directory structure for proper COOP/COEP headers
MIT-style. See LICENSE file for details.
This is a research project exploring WebAssembly-based virtual machine implementation with AI-assisted optimization. Contributions and discussions about the architecture and implementation approaches are welcome.
Special thanks to...
- Dan Ingalls for Smalltalk
- Vanessa Freudenberg for SqueakJS
- Eliot Miranda for Cog
- the WebAssembly community