Reference

Source map

Where to read the implementation, tests, and generated API documentation.

The kursal repository is the authority on the current language. Its root README has the latest bootstrap requirements and commands. The pages on this site are a guided way in, and the source and tests carry the exact behavior.

Implementation

Path What is there
compiler/ The self-hosted compiler, organized by phase. Its README covers storage, the backend, and language details for compiler authors.
reference-compiler/ The Python implementation, the KURS reader and writer, tests, and fuzzing tools.
lib/core/ Primitive library APIs: capabilities, memory, option and result, iterators, pointers, and more.
lib/alloc/ Heap and arena-backed owned collections.
lib/std/ Host-facing I/O, files, processes, text, and other standard APIs.
editors/ Tree-sitter grammars and queries for .kur and readable .kurs.

The library also includes libc, thread, and toml packages. The thread library notes explain ownership transfer into threads, and the raw-pointer contracts state the obligations behind safe standard-library APIs.

Examples

The walkthroughs cover the examples worth reading first. The examples guide lists every package, what it demonstrates, and how to run it. examples/bad/ contains programs the compiler must reject, including invalid uses of linear values.

API documentation

kursal doc generates a Krayon site from public modules and //! and /// documentation comments. It is a source-derived API reference, separate from the conceptual pages here. The documentation guide shows how to generate and build it. There is no item-level privacy yet, so internal helpers appear in the output.

Tests

The reference compiler tests build and run examples, compare the self-hosted compiler against the reference, and exercise rejected programs. The compiler README describes the self-build comparison and backend checks, and the fuzzing section describes the generated and mutated programs used to look for discrepancies.