Skip to content

Oxcaml support#2105

Open
vouillon wants to merge 34 commits intomasterfrom
oxcaml
Open

Oxcaml support#2105
vouillon wants to merge 34 commits intomasterfrom
oxcaml

Conversation

@vouillon
Copy link
Copy Markdown
Member

No description provided.

@vouillon vouillon force-pushed the oxcaml branch 14 times, most recently from e36ff51 to ebcbcf5 Compare October 3, 2025 11:22
@vouillon vouillon force-pushed the oxcaml branch 16 times, most recently from d354024 to d22f264 Compare October 16, 2025 15:30
vouillon and others added 30 commits April 9, 2026 10:25
Dune 3.20 provides the oxcaml_supported predicate, used to enable or
disable tests based on OxCaml availability.
OxCaml uses a modified bytecode format. Adapt the bytecode parser to
detect and handle both formats.
OxCaml alerts on concurrency APIs (Domain, Lazy, etc.) due to
potential race conditions. Suppress these in tests and library code
where the single-threaded JS environment makes them safe.
This tool runs tests in a toplevel environment by manipulating the
OCaml AST. OxCaml extends the AST, requiring a separate version.
Update gen.ml to select the appropriate variant.
Update ppx_deriving_json and ppx_js for OxCaml's extended AST.
Existing nodes have additional fields, primarily for modalities.
- sys: detect boot compiler
- hash: support renamed primitive (alias for compatibility)
- sys: add architecture detection primitives
OxCaml backports bytecode reification from 5.3. Add a 5.2-compatible
primitive that dispatches based on argument to support both behaviors.
OxCaml extends the standard atomic and domain APIs with many new
primitives. Add implementations for JS and Wasm.
OxCaml adds _local variants (e.g., caml_array_append_local) for local
allocation. Alias them to the standard primitives since JS/Wasm don't
distinguish local allocations.
OxCaml adds explicit primitives for immutable array conversions
(standard OCaml uses %identity at the library level). Map them to
identity in the bytecode parser.
OxCaml adds primitives that aren't applicable to JS/Wasm. Provide
no-op stubs or raise exceptions as appropriate.
OxCaml introduces mixed blocks (containing both boxed and unboxed
fields). Add support for recursive value initialization via the
caml_alloc_dummy_mixed primitive.
OxCaml handles asynchronous exceptions (e.g., Break) differently. Add
the caml_with_async_exns primitive and update the compilers to behave
appropriately when interrupted.
Add compiler and runtime support for OxCaml's or_null type, including
comparison, marshaling, and Obj primitives.
Add compiler and runtime support for OxCaml's unboxed float32 type,
including arithmetic, conversions, bigarray, and marshaling.
Allow array and string-like types to be indexed with unboxed integers
(int32#, int64#, nativeint#). Includes compiler support for JS and
Wasm code generation.
Add runtime primitives for 8-bit and 16-bit integers in JS and Wasm.
The bytecode compiler represents unboxed arrays as boxed arrays. Alias
the unboxed array primitives to the standard array operations.
These are implemented internally for bigarray support. Expose them for
use in other contexts.
Disable tests with different expected outcomes (e.g., raise is always
reraise in OxCaml). Adjust two tests to work with both.
Define empty stdlib_stable and stdlib_upstream_compatible in CI. These
are OxCaml-only libraries that the linter would otherwise report as
missing.
Add expected output for the primitive coverage test with OxCaml.
Set up GitHub Actions to test js_of_ocaml and wasm_of_ocaml with
OxCaml. Add OxCaml-specific setup script alongside the mainstream
OCaml one.
The OxCaml version is gated with [@@if oxcaml] on the let binding
instead of having per-pattern [@if oxcaml] annotations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Expose Import_info.make in the interface and use Import_info.table
type in parse_bytecode.mli instead of raw (string * Digest.t option)
tuples, ensuring compatibility with both OCaml and OxCaml.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add ppx_optcomp_light to compiler/lib-wasm for [@if oxcaml] support
- Register oxcaml as a built-in variable in the WAT preprocessor
- Fix caml_dynlink_open_lib to use 2-param signature for OxCaml
- Fix Option.map missing ~f: label for OxCaml's Import_info.make
- Fix Cmo_format.name/requires/provides to return Global_name.compunit
- Update prim check expected outputs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants