···11# ocaml-quickjs
2233-**Status: STUB PROJECT - Pure OCaml Port Needed**
33+**Status: STUB PROJECT**
4455## Overview
6677-Pure OCaml implementation of QuickJS JavaScript engine.
77+Pure OCaml implementation of QuickJS JavaScript engine. The goal is to create a portable JavaScript interpreter that can run on all OCaml targets (native, js_of_ocaml, wasm) without C dependencies.
8899-## Vendored C Reference
99+## Current State
10101111-- `vendor/git/quickjs-c/` - QuickJS C implementation from https://github.com/bellard/quickjs
1111+No OCaml code has been written yet. The project contains only:
1212+- Basic dune project scaffolding
1313+- Vendored C reference implementation (`vendor/git/quickjs-c/`)
12141313-## Goal
1515+The vendored QuickJS C source serves as a reference for the port. It includes:
1616+- ~2MB of core JavaScript engine code (`quickjs.c`)
1717+- Regular expression engine (`libregexp.c`)
1818+- Unicode support (`libunicode.c`)
1919+- REPL and compiler tools
14201515-Create a **pure OCaml port** of QuickJS to enable:
1616-- JavaScript execution in OCaml without C dependencies
1717-- Better integration with OCaml's runtime and GC
1818-- Portability to all OCaml targets (including js_of_ocaml, wasm)
2121+## Dependencies
2222+2323+- None yet (future: likely sedlex for lexing, menhir for parsing)
19242025## TODO
2126···2934- [ ] Write comprehensive test suite
3035- [ ] Benchmark against C implementation
31363737+## Build & Test
3838+3939+```bash
4040+# Currently no code to build
4141+dune build
4242+```
4343+3244## Notes
33453434-QuickJS is a small and embeddable JavaScript engine by Fabrice Bellard.
3535-It supports the ES2020 specification including modules, async generators, and proxies.
3636-A pure OCaml port would be valuable for:
4646+QuickJS is a small and embeddable JavaScript engine by Fabrice Bellard supporting ES2020.
4747+A pure OCaml port would enable:
3748- Sandboxed JavaScript execution in OCaml applications
3849- Static analysis and tooling for JavaScript
3950- Cross-platform JavaScript support where C bindings are problematic
40514141-## References
4242-5252+References:
4353- QuickJS website: https://bellard.org/quickjs/
4454- ES2020 specification: https://tc39.es/ecma262/