Kryos is a compiled, general-purpose programming language: memory-safe without lifetime annotations (ARC + move semantics — a Swift-like trade-off, not Rust's borrow checker), with native binaries and the clarity of Go. It ships a complete toolchain: compiler, formatter, LSP, package manager, debug info, and editor extensions — 30+ subcommands, 15 LSP capabilities, 60+ stdlib modules, and a cookbook of recipes.
fn main() {
println("Hello, Kryos!")
}
kryos run hello.kry- It's fast. Native binaries via LLVM — typically within a small factor of Rust/C on compute-heavy work, faster than Python by orders of magnitude, with honest losses listed first. Measured medians, methodology, and where Kryos loses (and why) in BENCHMARKS.md.
- It's safe. Memory safety by construction (ARC + move semantics), no
'alifetime annotations, no GC pauses. This is a Swift-like ownership model — simpler than Rust's borrow checker, and not equivalent to its compile-time guarantees (no data-race freedom proofs). Capability-typed effects catch I/O leaks at compile time. - It's small. One binary, no LLVM dependency for development, ~20 MB compiler, ~700 MB to build from source.
- It runs anywhere. Native (Linux / macOS / Windows / Intel / Apple Silicon) from the same source, plus an explicit-subset WebAssembly target (scalars, strings, closures, host-import I/O — anything outside the subset is a clear compile error, never a miscompile; see docs/wasm-contract.md).
- It self-hosts. The compiler is written in Kryos and reaches a byte-identical self-hosting fixed point — a self-host-compiled compiler recompiling its own source produces a bit-identical compiler (stage-3 == stage-4, SHA-256-verified). The self-host source type-checks clean (all 16 modules) and ownership-checks with zero errors; the reproduction bootstrap passes
--skip-ownershipfor byte-determinism (a codegen-determinism concern, not a checker failure). Stage-1 is Cranelift-compiled (a different backend), so it is not byte-identical to later stages. The per-module standalone compile check (test_bootstrap.sh) passes 16/16 modules. Seecompiler/self-host/bootstrap-win.sh. - The toolchain is done. 30+ subcommands including
run,build,check,test,bench,fmt,lint,audit,coverage,profile,trace,new,watch,clean,eval,doc serve,doctor,tree,pack,diff,info,workspace,config,welcome,cheat,changelog— the CLI surface is frozen for 1.x (see VERSIONING.md). - Stdlib is broad. 66 modules: fs, net, http, json, regex, datetime, duration, base64, uuid, hash, sort, collections, queue, stack, set, random, log, bytes, pathext, numfmt, strext, cmd, iter, and more.
- It governs AI agents at compile time — and they embed anywhere.
@capabilities(...)is authority the compiler tracks through the call graph and verifies (E05xxon violation). Three enforcement modes —permissive,inferred(deny-by-default with interior inference), andstrict(--strict-capabilities; all 90 examples pass it in CI). Deny-by-default is the default. A loosekryos run foo.kry— no flag, no project file — rejects any undeclared authority at compile time; you declare it once onmainand the compiler infers every helper, catching it through direct calls, method dispatch, or a builtin passed as a value.--capabilities-mode=permissiveopts out.kryos newscaffolds this posture. The compiler, examples, self-host compiler, and every ecosystem package are all deny-by-default (details in docs/capability-roadmap.md). Alongside it,@budgetrefuses before spending andTracked<T>carries provenance in the type. The same governed agent runs as a native binary, compiles to WebAssembly, and loads into Python / Go / Node / C# hosts through the C ABI with a machine-readable authority manifest — seeecosystem/kryos-embed/.
Status: Kryos is 1.0.0-rc.2 — a feature-complete beta with one primary author, not yet externally stress-tested. The CLI surface, LSP method set, stdlib symbol table, and ABI symbols are frozen for 1.x backwards compatibility. See STABILITY.md for the contract.
| If you want to… | Go to |
|---|---|
| Install and verify in 5 minutes | QUICKSTART.md |
| Learn the language (the manual) | docs/learn/ |
| Browse the full docs | docs/README.md |
| Build an MCP server in 60 seconds | kryos-mcp-template |
| Embed a governed agent in your Python/Go/Node app | ecosystem/kryos-embed |
| See what's verified working (apps, demos, probes) | SHOWCASE.md |
| Understand how it was built (and verified) | docs/HOW_THIS_WAS_BUILT.md |
| See real benchmark numbers | BENCHMARKS.md |
| Contribute | CONTRIBUTING.md |
| Understand the design philosophy | docs/WHY_KRYOS.md |
curl -fsSL https://raw.githubusercontent.com/NORTHTEKDevs/kryos-lang/master/install.sh | bashirm https://raw.githubusercontent.com/NORTHTEKDevs/kryos-lang/master/install.ps1 | iexAfter installing, verify the toolchain and take the tour:
kryos doctor # checks linker, stdlib, runtime libs
kryos welcome # first-run banner with an example workflow
kryos new hello && cd hello && kryos rungit clone https://github.com/NORTHTEKDevs/kryos-lang.git
cd kryos-lang/compiler
cargo build --release -j 2
./target/release/kryos --version # → kryos 1.0.0-rc.2Requirements: Rust 1.75+, a C compiler (cc/clang/MSVC) for linking. LLVM is not required for development — the LLVM backend emits IR as text. You only need clang or llc on PATH if you want optimized release binaries.
For a full walkthrough including build footprint and troubleshooting, see QUICKSTART.md.
fn fizzbuzz(n: i64) {
for i in 1..=n {
if i % 15 == 0 { println("FizzBuzz") }
else if i % 3 == 0 { println("Fizz") }
else if i % 5 == 0 { println("Buzz") }
else { println(to_string(i)) }
}
}
fn main() { fizzbuzz(20) }
enum Shape {
Circle(f64),
Rectangle(f64, f64),
Point,
}
fn area(s: Shape) -> f64 {
match s {
Shape::Circle(r) => 3.14159 * r * r,
Shape::Rectangle(w, h) => w * h,
Shape::Point => 0.0,
}
}
fn main() {
let ch = chan()
spawn {
let mut sum = 0
for i in 1..=10 { sum = sum + i }
send(ch, sum)
}
println("sum = " + to_string(recv(ch)))
}
async fn worker(name: str, n: i64) {
let mut i = 0
while i < n {
coop_record(name + to_string(i))
await 0 // yields to the scheduler
i = i + 1
}
}
fn main() {
coop_spawn(worker("A", 3))
coop_spawn(worker("B", 3))
coop_run() // → A0 B0 A1 B1 A2 B2 (genuinely interleaved)
}
Status:
awaitis a real cooperative suspension point — it hands control to the scheduler so another ready task runs, and tasks genuinely interleave undercoop_run()(verified on both backends). What is not yet shipped is a non-blocking I/O runtime:await http_get(url)yields cooperatively but the underlying socket read is still blocking. Soasync/awaitgives you cooperative concurrency today, not async I/O. See docs/09-concurrency.md.
@pure
fn hash(data: str) -> i64 {
// compile error if this calls io/net/process
compute_hash(data)
}
@capabilities(io)
fn read_config(path: str) -> str {
file_read(path)
}
One CLI, three backends:
| Backend | Use when | Speed |
|---|---|---|
cranelift (default) |
Dev loop, quick rebuilds | ~500ms cold |
llvm |
Release binaries, max throughput | Matches Rust --release |
wasm |
Browser, WASI, edge sandboxes | Portable bytecode |
kryos build hello.kry # Cranelift (fast)
kryos build --release hello.kry # LLVM (optimized)
kryos build --backend wasm hello.kry # WebAssemblyHonest numbers from BENCHMARKS.md — best of 10 runs, sandbox VM with a ~30 ms subprocess-launch floor (so very fast programs cluster at the floor; the real signal is on slower workloads).
| Benchmark | Kryos LLVM | Rust --release |
gcc -O3 | Go | Python |
|---|---|---|---|---|---|
| fib(35) | 0.032 | 0.032 | 0.032 | 0.064 | 1.118 |
| mandelbrot | 0.032 | 0.032 | 0.032 | 0.032 | 0.716 |
| nbody | 0.032 | 0.008 | 0.008 | 0.016 | 0.817 |
| binary_trees | 0.008 | 0.003 | 0.001 | 0.003 | 0.064 |
| fannkuch | 0.114 | 0.016 | 0.016 | 0.008 | 0.466 |
| matmul | 0.064 | 0.032 | 0.032 | 0.032 | 2.976 |
(seconds; lower is better)
Where Kryos shines: simple loops, recursion, and floating-point arithmetic — competitive with optimized C and Rust. Where Kryos still trails the C/Rust frontier: tight inner loops that depend on aggressive loop unrolling and bounds-check elision (fannkuch, nbody, matmul). The full per-benchmark analysis with "where we lose and why" is in BENCHMARKS.md.
The full toolchain. Not a roadmap — actually built and tested:
- Compiler — three backends (Cranelift / LLVM / WASM), zero cargo warnings, 670+ workspace tests passing
- Self-host — bootstrap reaches a byte-identical fixed point (stage-3 == stage-4); the self-host source type-checks and ownership-checks clean, and the per-module standalone compile check passes 16/16 modules. See docs/20-self-hosting.md
- Language — ownership, traits with
Self, generics, pattern matching, closures, capabilities, comptime, FFI (async/await parse but lower synchronously — see Status) - Standard library — 66 modules covering strings, math, collections, JSON, HTTP, regex, datetime, crypto, files, processes, channels, tensors, AI primitives
- Debug info — LLVM DWARF emission;
addr2lineresolves Kryos source lines in optimized binaries - Concurrency — real OS-thread parallelism with
spawn+ channels (chan<T>MPMC,select),actormessage-passing (private state, in-order handling, threads joined at exit), and non-blockingasync/await: a blocking I/O op (sleep,http_get,tcp_*) inside anasynctask yields the scheduler, socoop_spawnN tasks and their I/O overlaps — 4 × 300 ms of I/O finishes in ~300 ms, not 1.2 s (verified concurrent on both backends).awaitalso interleaves CPU-bound tasks cooperatively. - WASM stdlib parity — strings, arrays, JSON, regex, HTTP all callable from Kryos compiled to WebAssembly
- Package manager —
kryos pkg init / add / remove / install / publish / search / outdated. Lockfile, semver resolution, content-addressed checksums - Editor extensions — VS Code (live on the marketplace) and Zed (dev-extension)
- REPL, formatter, doc generator, test runner, LSP, C-header bindgen
- Package registry — full spec + dependency-free reference HTTP server in tools/registry/
Detailed release notes: CHANGELOG.md.
Kryos is built on a thesis: memory safety without lifetime annotations is achievable, and the "complexity tax" Rust imposes for safety is mostly avoidable if you accept ARC + move-semantics over borrow-checking. The trade is small: a tiny ARC overhead in exchange for code that looks closer to Go or Python than to Rust.
Kryos also takes seriously the idea that a language should ship with everything needed to finish a project. Stdlib, concurrency (spawn/channels/async), HTTP, JSON, regex, crypto, package manager — all in the box. You should be able to write a real program without picking 14 third-party crates and praying their version ranges align.
The third thesis is capability typing as a first-class compile-time check. @pure and @capabilities(io, net) aren't lint hints — they're enforced. A function annotated @pure that secretly calls file_read is a compile error, not a runtime surprise. This is the foundation for trustworthy plugin systems, sandboxed execution, and auditability.
kryos run [file|dir] Compile and execute (defaults to the current project)
kryos check <file.kry> Type-check without running
kryos build <file.kry> Compile to native (Cranelift default)
kryos build --release Compile via LLVM backend
kryos build --backend wasm Compile to WebAssembly
kryos fmt <file.kry> Format in place
kryos test Discover + run @test functions
kryos doc <file.kry> Generate HTML documentation
kryos repl Interactive REPL with persistent state
kryos pkg <subcommand> Package manager (init / add / install / publish / ...)
kryos bindgen <header.h> Generate Kryos bindings from C headers
kryos lsp Language server (used by VS Code / Zed extensions)
Kryos is v1.0.0-rc.2. Feature-complete language and toolchain + self-hosting compiler (bootstrap fixed point: stage-3 == stage-4, byte-identical; the self-host source type-checks and ownership-checks clean, with --skip-ownership used in the reproduction bootstrap for byte-determinism).
Why "beta", and what happened to v4? During the project's bring-up, version numbers tracked development sprints, not conventional semver maturity — the repo reached an internal "v4.46" within months, which would mislead newcomers about field maturity. Before public release the scheme was recalibrated: this is a feature-complete beta with one user. Historical tags (v0.x–v4.46) are preserved; the mapping is in VERSIONING.md. 1.0.0 final lands when external users have stress-tested it.
| Feature | Status |
|---|---|
| Type system + inference | Complete |
| Ownership / ARC + move semantics | Complete |
| Generics + monomorphization | Complete |
Traits with Self type |
Complete |
| Pattern matching + enums | Complete |
| Closures (ARC-captured) | Complete |
Channels + spawn + select |
Complete |
| Actors (message-passing) | Complete (JIT + AOT) |
| Async / await | Complete — non-blocking I/O (blocking ops yield the scheduler; async tasks overlap I/O) + cooperative CPU interleaving; both backends |
Capability enforcement (@pure, @capabilities) |
Complete |
@test runner, @copy, @pure CSE |
Complete |
| Cranelift backend | Complete |
| LLVM backend (native + DWARF) | Complete |
| WebAssembly backend | Complete |
| Module system + package manager | Complete |
| LSP, REPL, formatter, doc generator | Complete |
| Editor extensions (VS Code, Zed) | Complete |
| Package registry (spec + reference server) | Complete |
Quality bar (every release):
- Workspace lib tests: 670+ passing (70 suites, zero failures)
- MIR lib tests: 79/79
- Build warnings: 0
- Self-host bootstrap: byte-identical fixed point (stage-3 == stage-4, SHA-256); standalone per-module compile check passes 16/16 modules
The Kryos compiler is written in Kryos. Stage-0 is the Rust-implemented kryos.exe. Stage-1 is the Kryos-compiled compiler that stage-0 produces from compiler/self-host/*.kry (~22,300 lines of Kryos source). Because stage-1 is built by the Cranelift backend (a different backend), it is not byte-identical to later stages. The canonical bootstrap criterion is the fixed point: stage-3 == stage-4, SHA-256-verified (stage-2 is produced by the Cranelift-built stage-1, so it converges one stage later). The self-host source type-checks clean and ownership-checks with zero errors; the reproduction bootstrap passes --skip-ownership for byte-determinism (not because ownership checking fails). The 16 modules are token, lexer, ast, parser, types, mir, lower, optimize, regalloc, x86, codegen, elf, coff, linker, runtime, main; the standalone per-module compile check (test_bootstrap.sh) passes 16/16.
Verify yourself:
cd compiler
cargo build --release -j 2
# Byte-identical fixed point (the canonical criterion):
bash self-host/bootstrap-win.sh # → stage-3 == stage-4 (SHA-256)
# Per-module standalone compile check:
bash self-host/test_bootstrap.sh # → PASS: 16 / 16kryos-lang/
compiler/
crates/ 22 Rust crates (~115k lines) — the toolchain
stdlib/ 66 stdlib modules (.kry sources)
examples/ 51 runnable example programs (repo root)
docs/ 20-chapter manual + grammar + learn/
editors/
vscode/ Marketplace-ready VS Code extension
zed/ Zed extension scaffold
benchmarks/ Benchmark suite (Kryos vs Rust/gcc/clang/Go/Python)
tools/
registry/ Reference Kryos package registry HTTP server
install.sh Linux/macOS installer
install.ps1 Windows installer
Kryos is a real working language but it has one user. Things that move the needle right now:
- Try it. Write a small program. File an issue on anything that surprises you.
- Write a package. Anything reusable — a database driver, a CLI parser, a logging library, a date library. Tagged
good-first-packagein Discussions. - Port a benchmark. If you know another language well, port a real benchmark from it and tell us where Kryos surprises you (in either direction).
- Pick a starter task.
.github/STARTER_TASKS.mdlists scoped first-PR-sized tasks (cookbook recipes, stdlib additions, example programs, diagnostic polish, editor work). Issues taggedgood first issueon the tracker are also fair game. - Write a tutorial. Even a short blog post saying "here's how I built X in Kryos" is enormously valuable for adoption.
CONTRIBUTING.md has the full development setup. Discussions is the right place to ask anything open-ended.
- Discussions — github.com/NORTHTEKDevs/kryos-lang/discussions for questions, ideas, show-and-tell
- Issues — github.com/NORTHTEKDevs/kryos-lang/issues for bugs and feature requests
- Security — see SECURITY.md for private disclosure
- Email — info@northtek.io for direct contact
Apache License 2.0. See LICENSE.
Built by NORTHTEKDevs with heavy AI-assisted development. If you build something with Kryos, open a Discussion — I want to see it.