鎌 · Japanese farming tool, and weapon

Cut the bloat.
Keep the edge.

No garbage collector. No exceptions. No half-dozen ways to say the same thing. kama is a C-family language that cuts what slows down systems code, and keeps the ergonomics — generics, sum types, RAII, real OOP. It compiles to readable, portable C11, so it runs natively everywhere C runs, in the browser via WebAssembly, and on bare metal.

$ curl -fsSL https://kama-lang.org/install.sh | sh

The first AI-first, human-friendly language The ultimate type designer’s language The opt-in, pay-for-what-you-use language The safe, explicit-over-implicit language The modern systems language

Traditional OOP, no garbage collector, portable C output — the combination nothing else occupies. Rust and Zig drop OOP. C# and Swift carry a runtime. C++ keeps the footguns.

Install

one command
curl -fsSL https://kama-lang.org/install.sh | sh
curl -fsSL https://kama-lang.org/install.sh | sh
irm https://kama-lang.org/install.ps1 | iex

Installs into ~/.kama, no admin. Auto-detects a C compiler and falls back to a self-contained build that bundles zig cc, so kama build works with nothing else installed. Update any time with kama update. Prefer to build it yourself? Getting started has the manual and from-source paths.

To start something new: kama seed myapp writes a project — manifest, source file, .gitignore, README — and kama run builds and runs it. See Packages.

Why kama

what you get

No GC, no pauses

Deterministic RAII: every resource is destroyed exactly where it leaves scope. Nothing collects, nothing pauses, and a compiled binary ships no runtime beside it — just your code.

One way to do a thing

No positional calls, no switch fallthrough, one spelling for construction, one for scope resolution. Fewer ways to write it means fewer ways to get it subtly wrong — and code that reads the same no matter who wrote it.

Safe without a borrow checker

No null and no raw pointers in the safe surface. Ownership carries the safety — smart pointers, bounds-checked collections, and compile-time use-after-move detection. Raw memory lives inside an explicit, greppable unsafe fn.

Named parameters, always

temper(name: "kama", folds: 12). There are no positional calls, so a call site reads like the signature and argument order stops being a bug class.

Ownership is the type

Every declaration names its kind, and there are six: a value copies, a resource moves and drops, a view borrows, an enum is a closed set you match exhaustively, a contract is the guarantee, and an intrinsic gives a built-in primitive a contract’s methods. One greppable marker, no guessing.

No exceptions, no null

Optional<T> and Result<T, E> with exhaustive match. Construction that can fail returns a Result instead of leaving a half-built object behind.

Shared-nothing concurrency

Isolates, channels, structured scope blocks and parallel_for — race freedom by construction, not by annotation. No async colouring: an ordinary function is the only kind of function.

Compile-time evaluation

comptime constants and comptime fn run in the compiler and bake their results into the binary — lookup tables and checksums with nothing left to compute at startup.

Compiles to readable C

The output is portable ISO C11 you can read, debug and audit. It drops into an existing C codebase one file at a time, and C libraries come back the other way through the FFI.

Tooling on day one

A package and toolchain manager, one language server serving eight editors, and real source-level debugging — breakpoints in your .kama files, in your IDE and in browser DevTools.

What it inherits

and what it leaves behind

kama is not a reaction against the languages it came from — it is an attempt to keep the best of each without the part everyone works around.

C and C++

Kept: compiling straight down with nothing in between, abstractions that cost nothing at runtime, and RAII — tying a resource's life to a scope is still the best idea systems programming has produced.

Left: undefined behaviour as the default, the preprocessor, exceptions, and five ways to initialise a variable.

C#

Kept: the shape of the syntax you already read, and real object orientation — single inheritance, interfaces, modules, generics that read like generics rather than like template metaprogramming.

Left: the garbage collector, and the runtime that has to come with it.

Rust

Kept: sum types with exhaustive matching, Optional and Result in place of null and exceptions, moves and ownership as first-class ideas, and traits — spelled contract here.

Left: lifetimes and the borrow checker, and the async colouring that splits a codebase in two.

TypeScript, Node and Cargo

Kept: the idea that tooling is part of the language — a server that understands your code as you type, shipped in the compiler — and that packages, versions and a lockfile belong to the toolchain rather than to a third-party add-on.

Left: the dependency sprawl, and the runtime underneath it.

What is not inherited is the ownership model. Every type names its kind, and what it owns follows from that — value, resource, view, enum, contract, intrinsic — and that one decision is what buys memory safety without a garbage collector and without a borrow checker, while leaving ordinary OOP intact. Read the type model →

A taste of the blade

real, compiled code

import { core::println };

// A `value` owns nothing but its bytes, so it copies freely.
// The other kinds: `resource` owns and moves, `view` borrows, `contract` is a guarantee.
type value Steel
{
    public int32 carbon;

    // Construction is always a named constructor called on the type — no brace
    // literals, and `new` is only for the heap. The compiler checks that a
    // constructor sets every field, so a half-built value cannot escape one.
    public ctor make(int32 carbon)
    {
        this.carbon = carbon;
        return this;
    }
}

type enum ForgeError implements Error {
    TooFewFolds;

    public const fn string message() { return "a blade needs at least 8 folds"; }
}


// A `resource` owns something, so it moves instead of copying and its destructor
// runs at the end of the scope that owns it. No garbage collector, no pauses.
type resource Blade
{
    Steel steel;    // fields are private by default — a resource never exposes what it owns
    int32 folds;

    // The infallible constructor: nothing here can go wrong.
    public ctor make(Steel steel, int32 folds)
    {
        this.steel = steel;
        this.folds = folds;
    }

    // The fallible one returns a Result and fails *before* the blade exists,
    // so a half-forged Blade is not a thing that can be observed.
    public ctor Result<Blade, ForgeError> temper(Steel steel, int32 folds)
    {
        if (folds < 8)
        {
            return Result::Err(error: ForgeError::TooFewFolds);
        }

        println(s: "forging at ${folds} folds");
        return Result::Ok(value: Blade.make(steel: steel, folds: folds));
    }

    public fn int32 sharpness()
    {
        return this.folds * this.steel.carbon;
    }

    ~Blade() { }   // runs here, deterministically, when the owner goes out of scope
}

fn int32 main()
{
    Steel steel = Steel.make(carbon: 3);

    // `match` is exhaustive: handle every case, or it does not compile.
    // Each arm names the field it binds, exactly as a call names its arguments.
    return match (Blade.temper(steel: steel, folds: 14))
    {
        case Ok(value: blade): blade.sharpness();
        case Err(error: e):    1;
    };
}

This is not a mock-up: it is tests/site_sample.kama, compiled and run by the test suite on every build. Read the language tour for the rest of it.

What it costs

measured, not claimed

kama compiles to C and is built by the same clang as the C baseline, so parity with C is the design rather than a discovery. These are all nine native workloads — no subset, no favourites — each panel scaled to its own slowest bar. Lower is better; times are medians in milliseconds.

fibrecursive calls
C 5.95
kama 6.05
Rust 6.09
C++ 6.19
Go 10.09
pifloat throughput
kama 11.71
C 11.84
Rust 11.89
C++ 11.96
Go 13.92
collatzinteger + branches
Rust 66.86
kama 67.07
C++ 67.51
C 67.63
Go 91.64
dispatchvirtual dispatch
C 6.25
kama 6.48
Rust 6.52
C++ 6.62
Go 13.87
allocalloc / RAII churn
C 1.14
kama 1.34
C++ 1.62
Rust 2.29
Go 6.66
fnptrindirect calls
kama 2.48
C 2.50
Rust 2.67
C++ 2.70
Go 5.03
mapidiomatic hash maps
C++ 4.90
kama 5.24
Rust 8.27
Go 23.61
map_kernelhash map, one algorithm
C 2.70
kama 2.73
C++ 3.02
Rust 3.03
Go 4.84
mathvector / matrix math
C 3.09
kama 3.15
C++ 3.28
Rust 3.55
Go 79.02

2 MB peak

Resident memory on the integer workload — against 40 MB for the JVM. No collector means nothing stays resident waiting to be freed.

66 KB shipped

A self-contained native binary, no runtime to install — against 1.6 MB for the same program in Go.

Honest gaps

kama is at or ahead of C++ on 8 of 9 native workloads, and within a few percent of C on 7 of 8. map compares library design, not codegen — C has no stdlib hash map to enter there — while map_kernel runs one hand-rolled algorithm in every language and lands at C parity.

Measured on Linux aarch64 in a pinned container, 2026-09-21 13:07 — every language must return the same checksum or the run fails. C#, Java, Lua and Python are in the data but off this graph: from 1.4× to over 1400× they would flatten the cluster above. See the full benchmark tables for every language, peak memory, binary size, compile time, the WebAssembly track, and the caveats that come with each.

Where it runs

one language, three worlds

Native

Linux (x64, arm64), macOS (universal) and Windows (x64) toolchains, plus real cross-compilation to any <arch>-<os>-<abi> triple. Executables or static libraries.

The browser

WebAssembly is a first-class target, threads included. Debug it in DevTools with DWARF source maps back to your kama source.

Bare metal

Cortex-M firmware proven under QEMU: interrupt handlers, memory-mapped registers, inline assembly, and a @noheap attribute the compiler enforces.

Start here

Getting started

Install, write, build and debug your first program in about ten minutes.

Language tour

The whole language in one read, every snippet checked by the compiler in the test suite.

Specification

The complete reference — every type, keyword and standard-library module.

kama is MIT licensed and at v0.9.438, on the road to 1.0. The language feature set is complete; what remains is documentation and release polish. See the benchmarks for where it stands against C, C++, Rust and Go.