macOS arm64Objective-K — a Krypton ↔ Objective-C / Cocoa bridge built into the Mach-O backend. It lets pure Krypton programs call macOS 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 stdlibThe backend dyld-binds libobjc / Foundation / AppKit, then lowers a small family of objc_msgSend calls. Krypton's register calling convention already matches the arm64 ABI, so a Krypton function is usable directly as an Objective-C method IMP — that is how callbacks, data sources and delegates work.
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.
A Krypton func onClick(self, cmd, sender) is registered with class_addMethod and called by Cocoa with no shim. Multi-method delegates (table data sources, text-storage) work the same way.
Build Obj-C classes at runtime (objc_allocateClassPair) whose methods are Krypton funcs — custom NSViews with drawRect:, delegates, targets.
stdlib/cocoa.k + stdlib/objc.k wrap it: windows, buttons, text views, tables, menus, colours, fonts, timers — msg(obj, "setTitle:", nsString(s)) reads like Swift.
Krypton strings are NUL-terminated, so a string literal IS a valid char* — no marshalling to pass selectors, class names or text to Cocoa.
Programs with no foreign calls stay byte-identical (N=0 invariant), so adding the FFI never disturbs the bootstrapping compiler.