Documentation

KlainMainLang

A TypeScript-to-native compiler, written in Go, that emits LLVM IR and hands it to clang. You write .ts, it writes .ll, clang writes a real executable.

Personal / experimental project. One person, building this for fun and to learn how compilers actually work. Not audited, not hardened, no stability guarantees between commits. Perfect for tinkering, small CLI toys, and Docker microservices — bring your own garbage collector, or pass -mm=gc and let it bring one for you.

Where to go next

At a glance

  • The language is basically all there (~95%). Classes, generics, closures, async/await, unions, generics with constraints, mapped & conditional types.
  • You can write a real server. http.listen speaks HTTP/1.1 and HTTP/2, fs reads and writes, worker_threads and cluster give you real OS threads and processes, TLS on both ends.
  • Browser-shaped APIs that make sense off-browser. fetch, URL, WebSocket, Web Crypto, Streams, AbortController, timers.
  • What'll bite you. A bare : number is a JS-faithful double; reach for a sized int8uint64 type when you want integer semantics. Concurrency is cooperative. Nothing is dynamic. All deliberate — see the coverage matrix.