Install

curl -s https://valk-lang.dev/install.sh | bash -s latest

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

Fast GC

When it comes to creating and freeing objects, Valk is very fast.

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 100% perfect and that's the role Valk is trying to fill. We want to make a different and maybe better version of Go.

Another reason we started Valk is because we found a new way to do garbage collection. It's completely leak free and each thread has his own GC, so no stop-the-world pauses either. If memory gets shared across threads, it will automatically be taken care of by another GC that handles only shared data. But the main feature of this GC is that it is super fast.

Language details

  • Open source
  • Uses LLVM for the backend
  • Written in c, but will probably be converted to Valk once the standard library is stable
  • You can write low level unsafe code and link with c-libraries
  • We dont do politics, our community is for everyone
  • Donations go to the goal of having 1 or more full-time developers/maintainers