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

Performance

  • Valk 0.7.6
  • Go 1.27.1
  • Rust 1.97.1

Time in seconds, lower is better. Median of 5 runs after one warm-up.

HTTP hello world

Requests per second, higher is better
Valk http
8.30M
Rust hyper
7.55M
Go fasthttp
5.28M

Valk 0.7.2 http, Rust hyper 1.11 on tokio 1.53, Go fasthttp 1.73.

Garbage collection

Milliseconds, lower is better
ScenarioValkGoDC#
Short-lived alloc97413178
Churn with a large live set4778948
Tree churn40121251123
Free long-lived chain2554213

Go 1.27.1, LDC 1.43.0, .NET 10.0.112. Median of 3 runs.

Full results and source on GitHub ↗

Use cases

What you can build with Valk

Built in the open.

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