davesnx/sirocco

An experimental JavaScript runtime built with OxCaml and JavaScriptCore

OCaml

95

18 commits

updated Jan 20, 2026

See the code

README

sirocco

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.

Features

  • Node.js-compatible APIs: console, fs, process, path, Buffer, URL, EventEmitter, TextEncoder/TextDecoder
  • Callback and Promise support: Both fs.readFile and fs.promises.readFile styles 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

Contributors

davesnx

18 commits

davesnx/sirocco

An experimental JavaScript runtime built with OxCaml and JavaScriptCore

OCaml

95

18 commits

updated Jan 20, 2026

See the code

README

sirocco

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.

Features

  • Node.js-compatible APIs: console, fs, process, path, Buffer, URL, EventEmitter, TextEncoder/TextDecoder
  • Callback and Promise support: Both fs.readFile and fs.promises.readFile styles 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

Contributors

davesnx

18 commits

Languages

OCaml

73.5%

C

12.2%

JavaScript

9.7%

Shell

3.4%