Installation
There's no installer and no package to download — you build the compiler from source. It's a single Go binary once built, and a compiled program links nothing beyond plain libc unless it actually uses a feature that needs more.
Core toolchain
Two things are always required:
- Go 1.26+ — builds the compiler itself (see
go.modfor the exact pinned version). - clang (LLVM 15+, opaque-pointer support) — the backend that turns emitted LLVM IR into a native binary.
macOS (Apple Silicon or Intel)
# Homebrew — https://brew.sh
$ brew install go llvm
# clang from the llvm formula, or use Xcode's: xcode-select --installDebian / Ubuntu
$ sudo apt-get update
$ sudo apt-get install golang clangAlpine
$ apk add go clangClone & build
$ git clone https://github.com/memphisx/KlainMainLang
$ cd KlainMainLang
$ make build # → ./klainmain That produces ./klainmain in the repo root. Point it at a .ts file and run the binary it writes next to the source:
$ ./klainmain examples/basics/basics.ts # → examples/basics/basics
$ ./examples/basics/basics # run it yourselfOptional feature libraries
Every library below is linked only when your program uses the feature — the same conditional-linking convention throughout. A program that never touches these stays plain-libc, so install a library only when you hit the feature that needs it.
| Feature | Library | Install |
|---|---|---|
fetch / http.listen | libcurl | brew install curl · apt-get install libcurl4-openssl-dev · apk add curl-dev |
http.listen (h2c) | libnghttp2 | brew install nghttp2 · apt-get install libnghttp2-dev · apk add nghttp2-dev |
RegExp | libpcre2-8 | brew install pcre2 · apt-get install libpcre2-dev · apk add pcre2-dev |
crypto.subtle / tls / wss:// | OpenSSL 3 | brew install openssl@3 · apt-get install libssl-dev · apk add openssl-dev |
bigint | libtommath (default) | brew install libtommath · apt-get install libtommath-dev · apk add libtommath-dev |
-mm=gc (opt-in GC) | bdw-gc / libgc | brew install bdw-gc · apt-get install libgc-dev · apk add gc-dev |
crypto.getRandomValues / randomUUID use the OS CSPRNG directly and need no library. On macOS, -crypto=commoncrypto uses the built-in CommonCrypto with zero install. GMP is an alternative bigint backend via -bigint=gmp.