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?

Although many languages exist, not many meet our requirements. Mainly simplicity and performance. In our opinion, only Go was able to achieve this. But Go isnt perfect and that's the role Valk is trying to fill. We want to make a different and maybe better version of Go.

What can we do better?
- A faster GC without continual overhead (mark/sweep) + More control
- Better generics
- A package manager similar to npm/composer
- Namespaces
- Thread local storage variables
- Different error handling than Go
- More feature & large standard library
- Allow the use of c-libraries

Language details

We are an Open Source language under an MIT license. Currently we are using LLVM 🐌 as our backend. Our compiler is self hosted, meaning it can compile itself. We have a re-invented GC. We are using semi-stackful coroutines. So like, stackful but only sometimes. If you want to know more about the language, i suggest you join the discord and just ask us. ✌️