Compiler API
odoc for the OCaml bootstrap
The compiler is documented the way OCaml libraries are documented: module docstrings plus .mld pages, built with dune build @doc /just doc-compiler. That HTML is generated locally under _build/default/_doc/_html/ and is not a website. This page is the public map of those modules so the language has a home that is not only API reference.
From src/compiler/:
opam install odoc just doc-compiler # or: dune build @doc
The kina-compile executable reads a .kina file and writes .mlir:
dune exec bin/main.exe -- ../../tests/compiler/examples/add_2d.kina /tmp/add.mlir
Primary modules
- Emitter — Textual MLIR emission for tensor programs
- Type_formation — Type checking and formation, including Z3 obligations
- Sexpr_parser — S-expression / .kina parse entry
- Ir_typed — Typed intermediate representation
- Ast_surface — Surface AST after parse
- Shape_ops — Shape algebra used by checking and lowering
- Tensor_types — Dtype, shape, and refinement types
- Kina_core — Core language utilities
- Obligation — Proof / SMT obligations
- Source_loc — Source locations for diagnostics