sirocco is a lightweight and experimental JavaScript runtime written in OxCaml that embeds Apple's JavaScriptCore engine and provides Node.js APIs.
The event loop is powered by libuv (via the luv bindings), implementing the same async I/O model that Node.js (setTimeout, setInterval, and non-blocking filesystem operations).
Built with OxCaml, Jane Street's compiler fork and a set of extensions to OCaml focused on performance-oriented programming. It provides safe and predictable control over allocation, memory layout, and concurrency, while remaining fully backwards-compatible with OCaml. We don't leverage much of it yet (just nativeint for FFI pointers), but it might be the foundation for future performance work and a great learning playground for modes, unboxed types, and stack allocation.
- Node.js-compatible APIs:
console,fs,process,path,Buffer,URL,EventEmitter,TextEncoder/TextDecoder - Callback and Promise support: Both
fs.readFileandfs.promises.readFilestyles work - Support for async/await and Promises: Thanks to JavaScriptCore's ES6+ implementation
- Performance comparable to Bun: Same JavaScriptCore engine with native OCaml implementation
- Full ES6+ support: classes, modules, destructuring, spread operators
- Proper exception handling with stack traces