Kofun is an experimental programming language with a Kofun-written bootstrap
and direct ELF64 backends for x86-64 and AArch64. Source files use .kofun.
Website · Documentation · Playground · Implemented status · GitHub Project · Releases
Project status: research compiler, not a production language. “Active” means an executable gate exists in this repository. Design documents and open issues are not implementation claims.
Kofun's product direction is the language where you state an algebraic law and the compiler hands you a counterexample. General ownership and law checking remain open work.
Its systems target is equally explicit: Kofun is intended to become a
Rust/Zig-class, self-contained native toolchain. The accepted
kofun-only-native/v1
completion contract requires the compiler; direct ELF64, PE32+, and Mach-O 64
image writers for Linux, Windows, and macOS on x86-64 and AArch64; build,
package, test, and full-language fixed-point path to run in Kofun without a
host C/C++ compiler, assembler, linker, Rust, Cargo, Zig, Node.js, Python,
shell build driver, system SDK, or import library.
That is a target contract, not a claim about the bounded compiler today.
./bin/kofun --version
./bin/kofun check bootstrap/fixtures/answer.kofun
./bin/kofun run bootstrap/fixtures/answer.kofun
mkdir -p build
./bin/kofun build bootstrap/fixtures/answer.kofun -o build/answer
./build/answerSee Getting started for setup, supported targets, examples, and the complete CLI guide.
| Area | Checked boundary |
|---|---|
| Bootstrap | Kofun-written seed and reproducible generations |
| C backend | bounded C11 emission |
| Frameworks | HTTP, CLI, and TUI gates |
| Frontend | focused Stage 2 parsing, typing, and diagnostics |
| Interop | explicit C ABI and gated Rust shim checkpoints |
| Native | direct x86-64 and AArch64 checkpoints |
| Quality | conformance, diagnostic, Unicode, and fuzz gates |
| Self-hosting | frozen-profile three-generation fixed point reached; full-language self-hosting open |
| Tooling | LSP and typed sidecars |
| WebAssembly | checked-Int64 wasm32 core and browser tour |
These are bounded checkpoints, not a general parser, complete memory-safe runtime, or production toolchain. The semantic fixed point covers the frozen bootstrap profile, not the full language.
The implemented-status matrix
is the source of exact capability claims. Each row names a stable claim from
release/claims.json, its executable gate, and its
unsupported boundary. task release-claims fails when those disagree.
Looking for the compiler itself? It is
bootstrap/stage2/compiler.kofun, the
canonical front end written in Kofun, paired with
bootstrap/stage2/compiler.c, the hash-pinned
C11 seed that actually executes when you run the CLI.
Compiler architecture
explains which file runs when, and why a feature-named file under
bootstrap/stage2/ does not mean that feature compiles.
| Path | Owns |
|---|---|
bootstrap/ |
compiler stages, self-hosting, native, wasm32, and C ABI checkpoints |
spec/ |
normative contracts and executable specifications |
tests/ |
conformance, diagnostics, fuzzing, and integration gates |
framework/ |
bounded HTTP, CLI, and TUI libraries |
stdlib/ |
Kofun syscall and standard-library contracts |
docs/ |
source documents rendered by the official site |
The site, docs renderer, playground, and delivery snapshots live in
kofun-lang/kofun-site, which reads this
repository as a submodule. Use the
repository guide for
the full source/gate map.
The core gates require go-task, a POSIX shell, a C11
compiler, Node.js, and Linux x86-64 tooling. Digests are computed by the
repository's own kofun digest command, compiled from Kofun by the C11
Stage 2 backend, so no host sha256sum is needed.
task --list # available gates
task verify # everything CI runs
task diagnostics # registry and exact diagnostic fixtures
task release-claims # published wording and executable evidenceEvery task resolves to a checked-in script. Unsupported targets must refuse or report themselves explicitly; they must not silently fall back.
Read the contribution workflow.
Good starting points carry both
curated
and ready.
Releasing states what a version number promises and how a
release is cut. VERSION is the only place the number is written, the -seed
suffix marks every release cut before the compiler is a general parser and
type checker, and 0.x carries no compatibility promise — a claim in
release/claims.json is the promise, not the version.
Licensed under Apache-2.0 or MIT, at your option.