AI product Open source
djs is a small JavaScript and TypeScript engine written in no_std Rust and built mainly for WebAssembly. It runs codemode scripts, including model-written programs that call tools, process their results, and return data; the project describes it as a QuickJS replacement for pi's codemode.
The virtual machine stores all state in one byte array addressed by 32-bit offsets, allowing a new VM to be created by copying a prebuilt image and allowing the host to read results directly from that memory. Its interpreter avoids using the Rust call stack for JavaScript calls, so execution can be suspended between instructions and resumed inside callbacks, getters, and asynchronous functions. A suspended tool call can be serialized as a continuation dump containing JavaScript code that recreates the run. A single compilation pass produces stack bytecode while erasing TypeScript during parsing, and clock, randomness, and weak references are supplied by the host so identical inputs produce byte-identical heaps in native and WebAssembly environments.
djs is distributed as the @earendil-works/djs npm package and also provides a Rust CLI for running scripts, starting a REPL, and disassembling code. Its behavior is tested against dquickts, a QuickJS fork, and the repository includes documentation, architecture notes, testing instructions, and a pi codemode adapter.
2 uses taken from transcripts — each links to the moment in the video.
A compact JavaScript and TypeScript engine in Rust made to run inside WebAssembly. Its whole engine sits in one block of memory, so it can be frozen at any instruction and saved by copying bytes.
Tiny no_std Rust JavaScript/TypeScript engine targeting WASM32 for sandboxing AI-written tool-calling scripts, with suspend/resume and deterministic results.
2 in the library.