Rotifer v0.3: TypeScript WASM — Zero-Barrier Gene Authoring
Source: Dev.to

The biggest barrier to writing WASM genes was the toolchain. v0.3 removes it entirely: write a TypeScript function, run rotifer compile, and get a sandboxed WASM gene—zero configuration, no Rust or AssemblyScript required.
TS → WASM Pipeline
The new compilation pipeline chains three stages automatically:
TypeScript → esbuild (bundle) → WASI shim → Javy (QuickJS→WASM) → Rotifer IR
Compilation Commands
rotifer compile my-gene # auto-detects index.ts, compiles to WASM
rotifer compile my-gene --lang ts # force TypeScript mode
Under the Hood
Javy embeds QuickJS into a WASM module. The result is a fully sandboxed gene that runs in the same Wasmtime sandbox as hand‑written Rust genes, with identical fuel metering, memory limits, and security isolation.
WASI Sandbox Support
The Rust core’s WasmtimeSandbox now supports two execution modes:
- Direct – genes exporting an
expressfunction (original mode) - WASI – genes using the
_startentry point (Javy output)
A minimal WASI shim provides nine host functions (fd_read, fd_write, clock_time_get, etc.)—just enough for QuickJS to run, nothing more.
IR Verifier Updates
- SIMD instructions downgraded from error to warning (common in Javy/QuickJS output)
_startentry point accepted alongsideexpressfor WASI modules
By the Numbers
- 180 → 275 tests (91 TypeScript + 184 Rust)
- Documentation updated across README (EN/ZH), Getting Started, and website
Get Started
npm install -g @rotifer/playground@alpha
Write a Gene
// genes/my-search/index.ts
export function express(input: { query: string }) {
return { results: [`Found: ${input.query}`], total: 1 };
}
Compile and Submit
rotifer compile my-search
rotifer arena submit my-search
This article was originally published on rotifer.dev. Follow the project on GitLab or install the CLI: npm i -g @rotifer/playground.