Skip to content
CryoCryo home

Modern abstractions. Machine-level control.

Cryo is statically typed and compiles to native machine code through LLVM 20. The compiler is self-hosted, the standard library is written in Cryo, and one binary builds, tests, and ships your project.

curl -fsSL https://cryolang.org/install.sh | bash
Backend
LLVM 20
Targets
Linux · Windows
License
Apache-2.0

Familiar surface, explicit underneath

Generics, algebraic enums, pattern matching, traits, and single-inheritance classes - with manual allocation, raw pointers, and no garbage collector underneath them.

Full language reference
src/main.cryo
import std::fmt;

function main() -> int {
    fmt::printf("Hello, world!\n");
    return 0;
}

A namespace, a main, and a return code. printf is an intrinsic auto-imported into every module.

Three principles

The language is shaped by what it refuses to hide

Explicitness

No implicit conversions and no hidden control flow. Every cast is written out, and type inference stays local - so the cost of an operation is visible where it happens.

One toolchain

Build, run, test, fetch, init, and check are subcommands of a single cryo binary. The package manager, test runner, and dependency resolver ship with the compiler.

Ownership without lifetimes

Copy and Drop are inferred structurally, destructors fire at every scope exit, and use-after-move is a hard error - with no borrow checker, no lifetime annotations, and no garbage collector.

One binary

No build system to assemble

A project is a directory with a cryoconfig file. Scaffold it, build it, test it, and resolve its git dependencies with the same binary that compiles it.

cryo init
Scaffold a project - cryoconfig plus src/main.cryo.
cryo build
Compile the project. Incremental by default.
cryo run
Build, then execute the resulting binary.
cryo test
Discover and run every ![test] function, fork-per-test.
cryo check
Front-end and semantic analysis only; no codegen.
cryo fetch
Resolve dependencies and write cryoconfig.lock.
Every command and build flag
shell
$ cryo init hello
$ cd hello
$ cryo run

   Compiling hello v0.1.0
    Finished release [optimized] target(s)
     Running `build/hello`
Hello, world!

What ships in 1.0.0

Self-hosted compiler

Every line of Cryo you compile is compiled by a compiler written in Cryo. A 3-round, 6-stage build asserts the emitted IR is byte-identical between rounds, and it gates every push.

Monomorphised generics

Type parameters with where-bounds, specialised per instantiation. Abstractions compile down to the code you would have written by hand.

Deterministic destruction

Drop glue is synthesised recursively through struct fields, enum payloads, and container elements. Nothing is deferred to a collector, so release order is the reverse of declaration order, every time.

Async with no pinning

An async function compiles to a state machine that is an ordinary value type. Futures are never self-referential, so they move freely and cancellation is just a drop.

A standard library in Cryo

Collections, JSON, filesystem, threads, atomics, TLS, HTTP/1.1 and HTTP/2, and WebSocket - written in the language, shipping with the compiler.

A real FFI

Declare C functions by hand, or import a whole header under an alias and let the compiler synthesise the bindings. static_assert verifies your layouts against the C ABI.

Standard library

Batteries written in the language

Browse the module reference

Install it in one line

The quick-install binary is statically linked - it needs nothing on your machine but a C compiler to link the programs you build.

curl -fsSL https://cryolang.org/install.sh | bash