Karkain — Official Documentation
Karkain is a statically typed systems programming language for heterogeneous computing — CPU, GPU, NPU and quantum — with a self-hosted compiler written in the language itself. It compiles to C23 via GCC/Clang and ships a real CLI: build, run, test, format, debug, profile, package and cross-compile.
Note
Status: Karkain 1.1.0 (Stable). The implemented language core, standard
library and toolchain are functional and regression-tested on two engines
(the Go front end and the self-hosted kcc engine), with a documented
stable core and broad parity for the claimed surface. Large planned
surfaces (GPU/NPU/quantum kernels, an advanced package registry) are
not yet implemented. Nothing on this
site describes hypothetical features as available. Every advanced
capability states its real status.
Public status: Karkain 1.1.0 (Stable) (karkain --version →
Karkain Compiler v1.1.0 (... Stable Build)). See
Release Notes and Beta 1.
Feedback: open an issue at https://github.com/ajit-ai/Karkain/issues.
Quick tour
Getting Started — installation, a first program, and the project layout.
Language — fundamentals, types, constants, functions, control flow, structs, modules, and the memory model.
Standard library — every implemented
std.*module, currently string, collections, io, encoding, crypto and testing.Tools — the CLI, build, run, test, debug, profile, fmt and target.
Targets — cross-compilation with explicit target triples.
Internals — the compiler architecture, KCC, HIR, SSA, pipeline, runtime, and self-hosting.
Status — the honest status model and what is implemented.
Getting Karkain
Hey there. Create hello.kark:
println("Hello, Karkain!")
Build and run it:
$ karkain run hello.kark
Hello, Karkain!
That is the whole loop. From here read Getting Started for the full path — installation, first program, build, run, test, debug, profile, project structure, modules and dependencies.
Contents
The documentation is organized in three layers.
Learn Karkain
Karkain Developer
- Standard Library
- std.string — String utilities
- std.collections — Array and map helpers
- std.io — File and stream I/O
- std.encoding — Hex, Base64 and UTF-8 codecs
- std.crypto — SHA-256 and SHA-512 digests
- std.testing — Assertion and result helpers
- std.numerics
- std.net
- std.http
- std.db
- std.core — Core helpers (Experimental)
- std.math — Math functions (Experimental)
- Not Yet Implemented modules
- Tools
- Targets
- Karkain by Example
Karkain Internals
Status & Reference
How to read this documentation
Getting Started is the entry point for new developers: installation, a first runnable program, then build → run → test → debug → profile in the order you will actually reach for them.
Karkain Language Guide is the authoritative guide to the implemented Karkain language: syntax, variables, constants, types, functions, control flow, structs, modules, collections, errors and the memory model.
Standard Library documents the implemented standard-library modules. A
module is only listed when it is importable and tested — std.string,
std.collections, std.io, std.encoding, std.crypto and
std.testing today.
Tools covers the real CLI — every command, option, exit code and example.
Targets explains host and cross-compilation targets, including the Phase-111 cross-compilation behavior.
Compiler Internals is for contributors: the pipeline from source to
binary, the two engines (Go and self-hosted kcc), the IR layers, the
runtime boundary and the bootstrap/self-hosting story.
Status defines the vocabulary used everywhere on the site — Stable, Implemented, Experimental, Developer Preview, Planned and Not Yet Implemented — so you always know what is real today.
Project status
Area |
Status |
|---|---|
Language core (variables, functions, control flow, structs, modules) |
Implemented — tested on both engines |
Standard library |
Implemented — 6 importable |
CLI (build, run, test, fmt, debug, prof, target, pkg) |
Implemented |
Cross-compilation |
Implemented — explicit triples, deterministic failure |
Debugger / profiler |
Implemented — Go engine; kcc/wasm deferred |
Self-hosted compiler ( |
Implemented — byte-identical bootstrap |
Concurrency runtime |
Implemented — channels & actors |
SIMD / vector types |
Implemented — x86 + ARM lane types |
WASM ( |
|
GPU / NPU / quantum compute targets |
|
Networking, databases, web, AI/ML |
Planned — not yet supported |
Package registry |
Experimental — local resolver + lockfile; no registry |
The authoritative versioned language specification lives in SPEC.md
at the repository root; the Language Reference section distills the
parser-implemented reference behavior.
Legal
Karkain is released under the MIT License. See the repository
LICENSE file.