A compiled systems language for servers and tools.
Native code, coroutines for networking, a standard library with HTTP, JSON, TLS and cryptography, and no garbage collector.
Faster than Go at networking, with less memory and less CPU
| HTTP server, 64 keep-alive connections, 2 cores | ktm | Go 1.27 net/http | |
|---|---|---|---|
| Requests per second | 327,612 | 126,202 | 2.6x |
| Requests per CPU second | 164,008 | 70,187 | 2.3x |
| Memory (peak RSS) | 3.3 MB | 13.0 MB | 4x less |
Install on Linux x86_64 (other platforms)
curl -LO https://github.com/ozzenerol/ktm-lang/releases/download/v0.28.3/ktm-v0.28.3-linux-x86_64.zip
unzip ktm-v0.28.3-linux-x86_64.zip && cd ktm-v0.28.3-linux-x86_64 && sudo ./install.sh
hello.ktm
import net.http;
void hello(http.Writer *w, http.Request *r) {
u8[] name = r.query("name");
if !name.len { name = "world"; }
w.text(200, "hello, %s\n", name);
}
i32 main() {
http.Mux mux;
mux.handle("GET /", &hello);
return http.listen(8080, &mux);
}
$ ktm hello.ktm -o hello && ./hello &
$ curl 'localhost:8080/?name=ada'
hello, ada
- LanguageEvery part of ktm, one topic per chapter, with many small programs you can run.
- Quick GuidesOne task each, from an empty directory to a working program.
- LibraryEvery module, type and function of the standard library.
- ReleasesWhat changed in each version.
- RoadmapThe libraries that are done, and what comes next.
- Known issuesThe bugs ktm has today, and how to work around them.