Skip to content

Add OxCaml switch support #22

@cuihtlauac

Description

@cuihtlauac

Description

Add an optional OxCaml compiler switch, inspired by avsm/claude-ocaml-devcontainer which includes a 5.2.0+ox switch using Jane Street's experimental OCaml variant.

OxCaml is Jane Street's fork of OCaml that includes extensions for unboxed types, modal memory management (local allocations, uniqueness), and other experimental features. It's useful for training sessions that cover Jane Street's ecosystem or advanced type system features.

Approach

Add a third opam switch using the OxCaml custom opam repository:

opam repo add ox git+https://github.com/oxcaml/opam-repository.git

Key tools available in the OxCaml ecosystem (from Anil's design): async, core, parallel, ocamlformat, merlin, ocaml-lsp-server, utop.

Considerations

  • Image size: A third switch adds significant build time and image size. Consider whether this should be in the dev image or a separate optional layer.
  • Compiler version: OxCaml tracks a specific OCaml base version (currently 5.2.0). This will drift from our mainline 5.4.0 switches.
  • Tool compatibility: Not all opam packages build against OxCaml. The tool set may need to be a subset of what we install in the standard switches.
  • Custom opam repo: Requires adding the oxcaml/opam-repository as an additional opam repository source for that switch only.

Acceptance Criteria

  • OxCaml switch is created with the appropriate compiler variant
  • Core Jane Street libraries (async, core) are available in the switch
  • LSP and editor tooling works in the OxCaml switch
  • Test coverage for the new switch
  • Image size impact is documented

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions