Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
quickjs
quickjs.ml is a set of OCaml bindings to some libraries from QuickJS, a small and embeddable JavaScript engine that aims to support the latest ECMAScript specification.
This project exposes two libraries:
quickjs.c: Low-level OCaml bindings to QuickJS C libs (libregexp, libunicode, js_dtoa, js_atod, and cutils)
quickjs: A high-level API that mirrors JavaScript's built-in objects and methods. Modules include RegExp, String, Number, and Global.
Motivation
OCaml can target both native code and JavaScript (via Melange), enabling "universal" code that runs on both platforms. However, JavaScript's specific behavior (such as Unicode, number formatting, and regular expressions) often differs between native OCaml and browser engines. Rather than reimplementing these complex behaviors from scratch, we leverage QuickJS.
This project bridges that gap by bringing the same behavior as JavaScript engines (SpiderMonkey, JavaScriptCore, ChakraCore, v8) into native OCaml. With quickjs.ml, universal code produces identical results whether it runs natively or in the browser.
TC39/test262 Compatibility
We are translating TC39/test262 tests into OCaml to ensure full compatibility with the ECMAScript specification.