Downloads

Latest release: Krypton 2.0 · 2026-05-12

Windows installer

Recommended for Windows

One-click install to C:\krypton, adds the toolchain to your system PATH.

Download krypton-2.0-setup.exe 2.5 MB · Windows 10 / 11 x64 · admin install

What’s new in 2.0

Long-running programs become viable, and C is gone from the runtime. 2.0 lands the full mark-sweep garbage collector with shadow-stack rooting and freelist reuse, a complete pure-Krypton Win32 GUI surface with WindowProc callback dispatch, and the elimination of all three C companion DLLs. The stdlib, the runtime, and the user-program build path are now pure Krypton on Windows. The only C left in the project is bootstrap/kcc_seed.c, the cold-start seed.

  • Mark-sweep garbage collector. Per-let / per-param / per-reassignment shadow-stack pushes, per-RETURN restore, per-allocation 16-byte header, gcAllocsHead linked list, freelist reuse on sweep. gcMark() / gcSweep() / gcCollect() / gcFreelistCount() as first-class builtins.
  • Lambdas and closures. Closures via env-passing with snapshot semantics; int + pointer captures both round-trip cleanly. Per-call overhead measured at <10 cycles — below noise. stdlib/fp.k is canonical (cb: closure typed receivers).
  • Typed pointers and stack-shaped allocations. let p: *u8 = s; p[i] lowers to bufGetByte directly. *u16 / *u32 / *u64 / signed variants. Struct fields with offset tracking. let local TYPE name (heap-backed now; syntax forward-compatible with true stack alloc).
  • Win32 ABI marshalling. ~30 Win32 functions auto-marshalled by x64.k: Sleep(500), GetTickCount(), GetSystemMetrics(0) work directly. Registry surface (RegOpenKeyExAGetUserNameA) fully marshalled.
  • Pure-Krypton GUI stdlib. Complete Win32 surface in stdlib/gui.k — windows, buttons, RichEdit, listboxes, treeviews, tabs, status bar, toolbar, menus, sliders, spinboxes, splitters, dock panels, file/color/folder dialogs. WindowProc trampoline in krypton_rt.dll bootstrap so Krypton funcptrs serve as lpfnWndProc. Replaces ~5800 lines of C from the old ckrypton_gui.dll.
  • C elimination. ckrypton_gui.dll / ckrypton_fs.dll / ckrypton_proc.dll all gone. runtime/ directory has zero C source. The user-binary IAT shrank from 14 DLLs to 11.
  • Native PE/COFF backend. kcc -o foo.exe builds directly — no per-build gcc. krypton_rt.dll is bootstrap-emitted machine code, not C.
  • Odin-style import prefixes. import "k:gui" for stdlib, import "head:windows" for header bindings. Aliases: core:k:, headers:head:. Legacy plain-filename imports still resolve.
  • Inline asm primitives. pause(), mfence(), lfence(), sfence(), rdtsc().
  • mmap files + native stdio. stdlib/mmap.k (mmapFile(path) → zero-copy bufGetByte reads) and stdlib/winio.k (winioStdin/Stdout/Stderr via WriteFile / ReadFile — no cfunc body).
  • Regression sweep: 82 / 85 native pipeline. 19 / 19 GUI tutorials build and smoke-run cleanly. Real-world: kryofetch 1.0 builds end-to-end.

Full prose notes: releasenotes/RELEASE_NOTES_2.0.txt. Deep dive on the memory model: docs/v20_mark_sweep_design.md.

What you get

  • kcc.exe — the Krypton compiler (file-properties version 2.0)
  • krypton_rt.dll — runtime (bootstrap-emitted machine code, no C source)
  • krypton_rt_legacy.dll — used during rt.dll self-rebuilds (load-bearing)
  • x64_host.exe + optimize_host.exe — native PE/COFF backend hosts
  • kcc.sh — driver script for git-bash / WSL
  • headers\*.krhhead: import targets (Win32, POSIX, libc, GUI, common dialogs)
  • stdlib\*.k — pure-Krypton stdlib (k: imports)
  • README.md, LICENSE, CHANGELOG.md

Installer behaviour

  • Forces install to C:\krypton — keeps tutorial paths stable
  • Adds C:\krypton to system PATH (idempotent — won’t duplicate)
  • Same AppId as 1.4.0 / 1.5.x / 1.6.x / 1.7.x / 1.8.x — upgrades existing installs in place (no second Add/Remove Programs entry)
  • Closes a running kcc.exe mid-install if needed
  • Optional: .k file association, desktop icon (both off by default)
  • ignoreversion on every file — re-install always refreshes the DLLs
  • Runs kcc --version as a post-install smoke test
  • Uninstall removes C:\krypton from PATH and prunes empty dirs

macOS arm64 installer

Recommended for Apple Silicon

One-click install to /usr/local/krypton, adds the toolchain to /etc/paths.d/.

Download krypton-2.0-macos-arm64.pkg ~534 KB · Apple Silicon (M1/M2/M3/M4) · macOS 14+

First-class macOS arm64 support

2.0 is the first Krypton release where macOS arm64 reaches functional parity with the Windows native pipeline on the supported subset. No clang at user-program build time. Clang is only needed on a fresh-from-source install to compile kcc_seed.c, and the .pkg ships a prebuilt seed so even that one-time path is skipped for end users.

  • Mach-O native backend. compiler/macos_arm64/macho_arm64_self.k grew from ~520 lines (May 2026) to ~4000 lines. Direct Mach-O emission with inline ad-hoc SHA-256 codesign — no codesign external call.
  • Mark-sweep GC, ported. Shadow stack at __DATA + 0xA000, per-allocation 16-byte header, gcAllocsHead linked list, 13 of 17 GC builtins real (none stub). Matches the Windows algorithm written from scratch for Apple Silicon.
  • Polymorphic operators. kp(int) dispatches at runtime to inline itoa + raw write(); + handles int+int / str+str / mixed; == / != do byte-by-byte strcmp for both-pointer case. Backtick interpolation works natively.
  • For-in support. range / length / split as native builtins. for i in range(0, N) { ... } works clang-free.
  • LSP server bundled. kls ships in the .pkg, built clang-free via --native.
  • Native test sweep: 35 / 39 (up from 3 / 39 at the start of the 2.0 arc). Three remaining failures are narrow: an operator-precedence question (test_arithmetic.k), a likely-already-fixed test_booleans.k, and the missing environ builtin (test_env_ops.k).

Known limitations on macOS arm64

  • DATA_VMSIZE capped at 64 KB on Tahoe. Tested 1 MB / 16 MB / 64 MB — every value above 64 KB is rejected by the kernel at process start. The bump allocator never recycles freed memory, so the macOS arm64 backend cannot yet self-host compile.k. Headline 2.1 work: mmap a heap outside __DATA.
  • Some builtins not yet ported. Float ops, map/struct helpers, several list/string utilities, callPtr, random, timestamp, and the rdtsc / fences family fall through silently on --native. Use --gcc (still supported) until they land in 2.1.
  • No GUI. stdlib/gui.k uses Win32 IAT imports. A Cocoa/AppKit backend is not started.

Install

sudo installer -pkg krypton-2.0-macos-arm64.pkg -target /
# or, in Finder:
open krypton-2.0-macos-arm64.pkg

After install, open a fresh terminal:

kcc --version          # → "kcc version 2.0"
kcc.sh hello.k -o hello && ./hello

Uninstall

sudo rm -rf /usr/local/krypton /etc/paths.d/krypton
sudo rm -f /usr/local/bin/kcc /usr/local/bin/kcc.sh /usr/local/bin/kls

Linux · other platforms

Bootstrap from source — no installer needed. Prebuilt seeds ship in bootstrap/ so gcc / clang is only needed once.

Linux x86_64

git clone https://github.com/t3m3d/krypton
cd krypton
./build.sh

Output: native ELF binaries via the compiler/linux_x86/elf.k backend, direct syscalls, no libc. 2.0’s GC infrastructure currently lives in the Windows and macOS arm64 native backends; Linux ELF picks it up in 2.1.

Linux aarch64

Same git clone + ./build.sh. The build script auto-detects ARM64 Linux and uses the prebuilt seed at bootstrap/kcc_seed_linux_aarch64. Programs compile via the C path under --gcc. A native ARM64-Linux backend (compiler/linux_arm64/elf_arm64.k) is in progress for 2.1.

Intel macOS

Supported via the C path. Same git clone + ./build.sh; the script auto-detects and routes through clang. The native pipeline targets Apple Silicon; Intel Macs use the legacy Mach-O backend (compiler/macos_arm64/macho.k) plus clang.

VS Code extension

Syntax highlighting for .k files — backtick interpolation, all current keywords (jxt, cfunc, callback, match, try/catch), hex literals, the full builtin list including the 2.0 GC primitives (gcMark, gcSweep, gcCollect, gcFreelistCount, gcShadowPush, …), the typed-pointer syntax (*u8 / *u16 / …), and the inline asm primitives (pause, rdtsc, fences).

code --install-extension vscode-ext-krypton-language-1.8.4.vsix --force

VS Code Insiders: substitute code-insiders for code. The --force flag overwrites any older build.

Download vscode-ext-krypton-language-1.8.4.vsix →

Verify your install

kcc --version
# kcc version 2.0

That’s it — if kcc is on your PATH and reports 2.0, you’re ready to build.

Older versions & release history

Per-release detail (compiler changes, runtime additions, known gaps) lives in CHANGELOG.md, with prose release notes archived under releasenotes/. Prior installers and seed binaries are archived on the GitHub releases page.

Roadmap for 2.1: docs/v20_plan.md. macOS arm64 GC + native-pipeline details: docs/macos_gc_port_plan.md. M1 setup & workflow: docs/HANDOFF_M1.md.