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 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.


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

Current overall status

Area

Status

Language core (variables, functions, control flow, structs, modules)

Implemented — tested on both engines

Standard library

Implemented — 6 importable std.* modules

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 (kcc)

Implemented — byte-identical bootstrap

Concurrency runtime

Implemented — channels & actors

SIMD / vector types

Implemented — x86 + ARM lane types

WASM (wasm32-wasi)

Production Candidate — Go-engine backend,

wasmtime-gated; WASI exit codes, stderr and getArgs() implemented

GPU / NPU / quantum compute targets

Experimental — Phase 124: compute-target model and KIR

lowering boundary; the language surface for kernels stays Planned

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.