objk iconmacOS arm64

objk

Objective-K — Krypton's human UI language layer for native apps. Choc is the macOS backend built into the Mach-O toolchain, letting pure Krypton programs drive AppKit & Foundation directly so a real native GUI app can ship with no Obj-C, no Swift source. It is what stem and brain are built on.

How it worksView stdlib

Krypton calling native UI, with no Objective-C source

Choc binds Foundation and AppKit from the Mach-O backend, then lowers the small message-send family Objective-K needs. Krypton's register calling convention already matches the arm64 ABI, so a Krypton function can be used directly as a native UI callback — that is how callbacks, data sources and delegates work.

objc_msgSend family

Dispatch wrappers for 0–6 args, plus NSRect (d0–d3), CGFloat, NSSize, NSPoint+ptr, 256-colour RGBA, and NSTimer variants — each one is a tiny lowering in the backend.

Funcs as callbacks

A Krypton func onClick(self, cmd, sender) is registered by Choc and called by the native UI with no shim. Multi-method delegates (table data sources, text-storage) work the same way.

Runtime class synthesis

Build native UI classes at runtime whose methods are Krypton funcs — custom views with drawRect:, delegates, targets.

Ergonomic stdlib

stdlib/choc_macos.k + stdlib/okui.k wrap it: windows, buttons, text views, tables, menus, colours, fonts, timers — human Objective-K calls over platform handles.

Strings pass through cleanly

Krypton strings can pass selectors, class names, and UI text through Choc without app code doing manual marshalling.

Self-host safe

Programs with no foreign calls stay byte-identical (N=0 invariant), so adding the FFI never disturbs the bootstrapping compiler.

What it powers

Real, shipping apps — not demos:

stem · a terminal (NSWindow + grid + pty). brain · an IDE (NSTextView, NSTableView, tabs, menus). Both pure Krypton.