An experimental JavaScript runtime built with OxCaml and JavaScriptCore
  • OCaml 73.5%
  • C 12.2%
  • JavaScript 9.7%
  • Shell 3.4%
  • Makefile 0.7%
  • Other 0.5%
Find a file
2026-01-20 14:05:00 +00:00
.github/workflows Initial commit 2026-01-01 15:56:04 +00:00
bench bench: update compare script 2026-01-08 09:23:26 +00:00
bin Initial commit 2026-01-01 15:56:04 +00:00
demo deps: add httpun 2026-01-08 09:23:36 +00:00
docs Initial commit 2026-01-01 15:56:04 +00:00
lib Implement performance.now() 2026-01-20 14:05:00 +00:00
test test: timer benchmarks 2026-01-08 09:23:45 +00:00
.gitignore Initial commit 2026-01-01 15:56:04 +00:00
.ocamlformat Initial commit 2026-01-01 15:56:04 +00:00
dune-project deps: add httpun 2026-01-08 09:23:36 +00:00
jsc.opam Initial commit 2026-01-01 15:56:04 +00:00
jsc.opam.template Initial commit 2026-01-01 15:56:04 +00:00
Makefile Initial commit 2026-01-01 15:56:04 +00:00
README.md Initial commit 2026-01-01 15:56:04 +00:00
sirocco.opam deps: add httpun 2026-01-08 09:23:36 +00:00

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