Install

Windows Linux / Macos
curl -sSL https://valk-lang.dev/install.sh | bash

Example

use valk:http

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

fn main() {
    let host = "127.0.0.1"
    let port : u16 = 9000
    let s = http:Server.new(host, port, handler) ! {
        println("Failed to initialize http server")
        return
    }
    println("HTTP server - http://" + host + ":" + port)
    s.start()
}

Features

  • Fast run/compile time
  • Strict type system 👮
  • Generics 🧩
  • Coroutines 🫧
  • Package manager 📦
  • No undefined behaviour
  • Cross compiling

Amazing performance

Valk can compete with the fastest languages out there. Our GC performance is amazingly fast. Visit our github page to see some of our benchmarks.

Valk
# time ./valk/objtree 20
real 0m2.130s
user 0m2.125s
sys 0m0.005s
Rust
# time ./rust/objtree 20
real 0m3.611s
user 0m3.606s
sys 0m0.005s
Go
# time ./go/objtree 20
real 0m6.017s
user 0m6.012s
sys 0m0.005s

Why did we make Valk?

We wanted to create a language that has the perfect balance between simplicity and performance. We didnt feel like existing languages were doing a good job at this except for Go. But Go, although very good, has it's own oddities. We wanted to see if we could do it better.

What can we do better?
- A faster GC (no mark/sweep performance bottleneck)
- Better generics
- A package manager similar to npm/composer
- Different way to handle public/readonly/private
- Thread local storage variables
- Simple/short syntax for error handling
- Allow the use of c-libraries

Language details

- Open source
- MIT license
- LLVM backend
- Self hosted (can compile itself)
- Persistent GC (keeps state, no mark/sweep)
- Semi-stackful coroutines

If you want to know more about the language, join our discord and just ask. ✌️