The Valk programming language

A fast, simple & safe programming language.

Native performance, a strict type system, and concise syntax. Build for Linux, macOS, and Windows.

curl -sSL https://valk-lang.dev/install.sh | bash
server.valk
use valk.http

fn handler(req: http.Request) http.Response {
    return http.Response.text("Hello world!")
}

fn main() {
    let server = http.Server.new("127.0.0.1", 9000, handler)
    server.start() ! panic("Failed to start server")
}

$ valk build server.valk --run

$ curl http://127.0.0.1:9000

Hello world!

The language

Simple to write, fast to run.

  • Native compilation

    An embedded LLVM backend turns your code into a native binary, no runtime to install.

  • Strict types and generics

    Nullable values, errors and generic code are checked when you build, not when you run.

  • Coroutines

    Stackful coroutines start small, 4 to 32 KB, and grow when they need more stack.

  • C compatible

    Call C libraries with extern and export functions to C; structs follow each platform’s C ABI.

  • Package manager

    vman installs packages for your project and switches between Valk versions.

  • Garbage collected

    Memory you no longer use is freed for you; there are no manual frees or lifetimes to manage.

Benchmarks

Built for real performance.

Native performance, with simple syntax and a productive development experience.

Valk 0.7.11 · Go 1.27.1 · Rust 1.97.1

Full results and source on GitHub ↗

HTTP hello world

Requests per second, higher is better.

Valk
10.22M
Go
6.03M
Rust
8.47M

Compares Valk HTTP, Rust hyper, and Go fasthttp serving a small “Hello world” response. Measures requests per second under concurrent load, using all CPU cores.

binary-tree

Time in seconds, lower is better.

Valk
0.50s
Go
1.34s
Rust
2.50s

Builds and traverses binary trees of different depths, mixing temporary trees with one long-lived tree. Tests allocation, pointer access, and memory reclamation.

json-serde

Time in seconds, lower is better.

Valk
0.20s
Go
0.31s
Rust
0.23s

Decodes a GeoJSON document into typed objects 50,000 times, then serializes the results back to JSON. Tests parsing, object creation, and encoding.

lru

Time in seconds, lower is better.

Valk
0.36s
Go
0.77s
Rust
0.44s

Exercises a 1,000-entry least recently used cache over 11 million iterations. Measures hash-map access, linked-list updates, and eviction.

Spectral norm

Time in seconds, lower is better.

Valk
0.63s
Go
0.64s
Rust
0.64s

Approximates a matrix’s spectral norm through repeated matrix–vector products. Uses four workers to test floating-point computation and parallel execution.

Use cases

What you can build with Valk

Built in the open.

Explore the source, follow the roadmap, or join the conversation.