Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

oxcaml

БесплатноБез исполняемых скриптовНе проверен

Working with the OxCaml extensions to OCaml. Use when the oxcaml compiler is available and you need high-performance, unboxing, stack allocation…

avsmот avsm★ 41 звезда на GitHub

Об этом скилле

You are writing code for the OxCaml compiler, a performance-focused fork of OCaml with Jane Street extensions. This guide covers OxCaml-specific features only; standard OCaml is assumed.

Current target: OxCaml 5.4.0-ox9 — oxcaml-compiler.5.4.0-ox9 / ocaml-variants.5.4.0+ox, on the OCaml 5.4 base (ocamlopt -version prints 5.4.0+ox for every ox release; the exact check is opam var oxcaml-compiler:release). The previous target was 5.2.0minus-39 (OCaml 5.2 base).

Migrating a project from minus-39? Follow MIGRATION-39-ox9.md: step-by-step guide, error-message lookup table, before/after code checked on both compilers, forms that build on both.

Change history, newest first: CHANGES-39-ox9.md (5.2.0minus-39 → 5.4.0-ox9: minus-40, the upstream OCaml 5.4 merge, ox1 … ox9), CHANGES-38-39.md, CHANGES-31-38.md, CHANGES-25-31.md, CHANGES-23-25.md.

Quick Upgrade Flags (minus-39 → ox9)

When a build fails after a bump from minus-39, check these first (most common first; the fix for each and an ordered checklist are in MIGRATION-39-ox9.md):

  • int64#, int32#, nativeint#, float32# are gone → int64_u, int32_u, nativeint_u, float32_u ("The type int64 has no unboxed version. Hint: Did you mean int64_u?"). Literals (#42L), float#/int8#/int#/…, and "%…#…" primitive names are unchanged. int64_u box ≠ int64.
  • Rebuild everything, ppx rewriters and tools included (magic numbers 578 → 586); Jane Street libraries move to v0.18~preview.133.03+642.
  • effect is a keyword → rename identifiers or pass -keywords 5.2.
  • Tooling gaps: no odoc for ox9 (dune build @doc cannot work); ocamlformat 0.29.0+ox rejects a version = … line in .ocamlformat and cannot parse | effect patterns, overwrite_ or val poly_; on arm64 ocaml_simd needs a CPATH workaround to install (MIGRATION-39-ox9.md step 0).
  • fst p / snd p on a local pair in tail position is an error: bind the result, add [@nontail], or use exclave_ (section 2).
  • type ('a : any) t = { x : 'a } needs -extension layouts_beta (minus-39 silently narrowed the annotation).
  • All-void constructors (A of unit#) need [@immediate_all_void_constructor].
  • New default-on warnings: 181 imprecise-kind-annotation, 183/184 kind modifiers, 220 redundant-modality (@@ global aliased, mutable f : t @@ aliased); 211 renamed mod-by-top → redundant-modifier (use -211); 189 → 75.
  • Effect.perform raises an unsafe_effects alert → use Effect.Safe.perform.
  • { t with … } may not implicitly copy an [@atomic] field.
  • Integer literals at max+1 (128s, 32768S, 9223372036854775808L, …) are errors — they used to wrap to the minimum.
  • compiler-libs.common was split: add compiler-libs.frontend for Path/Types/Env/Typedtree/….
  • SIMD load/store primitives on float array removed; AVX-512 types need -extension simd_beta.
  • Runtime 4 retired: --disable-runtime5 is a configure error.
  • Error messages no longer double-quote identifiers in uncoloured output (matters when grepping compiler output or comparing against older docs) and many were reworded → re-promote expect tests.
  • C stubs: caml_failure_exn removed (use caml_exception_failure_value); caml_callback_res/caml_result supersede the _exn variants (which still compile).

Detailed Guides

Feature Guide
Modes (local, unique, once, portable, contended) SKILL-MODES.md
Stack Allocation (local_, stack_, exclave_) SKILL-STACK-ALLOCATION.md
Unboxed Types (float#, int64_u, mixed blocks) SKILL-UNBOXED.md
Kinds (value, float64, bits32, kind products) SKILL-KINDS.md
Uniqueness (unique/aliased, once/many) SKILL-UNIQUENESS.md
Comprehensions (list/array builders) SKILL-COMPREHENSIONS.md
SIMD (vector types, SSE/AVX intrinsics) SKILL-SIMD.md
Templates (ppx_template, mangling) SKILL-TEMPLATES.md
Zero-Alloc ([@zero_alloc] checking) SKILL-ZERO-ALLOC.md
Base Library (OxCaml extensions) SKILL-BASE.md
Core Library (OxCaml extensions) SKILL-CORE.md

1. Modes

Modes track runtime properties of values. Each mode axis is independent.

Axis Values Default Purpose
Locality local, global global Where value lives (stack vs heap)
Uniqueness unique, aliased aliased Number of references
Linearity once, many many How often closures can be called
Portability portable, corruptible, `share
Полный SKILL.md на GitHub

Установить oxcaml в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

CHANGES-23-25.mdCHANGES-25-31.mdCHANGES-31-38.mdCHANGES-38-39.mdCHANGES-39-ox9.mdMIGRATION-39-ox9.mdSKILL-BASE.mdSKILL-COMPREHENSIONS.mdSKILL-CORE.mdSKILL-KINDS.mdSKILL-MODES.mdSKILL-SIMD.mdSKILL-STACK-ALLOCATION.mdSKILL-TEMPLATES.mdSKILL-UNBOXED.mdSKILL-UNIQUENESS.mdSKILL-ZERO-ALLOC.md

FAQ

Что делает скилл oxcaml?

Working with the OxCaml extensions to OCaml. Use when the oxcaml compiler is available and you need high-performance, unboxing, stack allocation, data-race-free parallelism

Как установить скилл oxcaml?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл oxcaml запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить oxcaml с