These libraries are experimental. APIs may change without notice. Generated from source with koruc 0.1.7 on 10/5/2026.

Metal

@korulang/metal@0.0.1

Metal + AppKit window for Koru — pure objc_msgSend, phantom window lifecycle, frame-loop-as-effect-branch

metal/index.kz · 7 tors

@korulang/metal — a Metal window for Koru (v0: open + clear + close) · 23 more lines
@korulang/metal — a Metal window for Koru (v0: open + clear + close) Tracer for the native-app assimilation path: can Koru drive an Objective-C-flavored API with no shim? Everything below goes through objc_msgSend typed casts — no .m file, no wrapper library, just the ObjC runtime's C surface plus the few genuinely-C entry points (MTLCreateSystemDefaultDevice, CFStringCreateWithCString). The C footguns this compiles away, same bet as raylib/index.kz: 1. A window you open and never render is leaked Cocoa state — here it is a KORU030 outright: `frames` is the only route to <active!>, and <active!> is the only state window.close accepts. 2. Rendering without a drawable/descriptor bracket is a silent no-op — here every draw call borrows a *Frame<frame> that only exists inside the `! frame` effect-branch body: the pass descriptor lives between the engine's bracket, so drawing outside a frame is not expressible. 3. Forgetting to end/present a command buffer hangs the swap — the engine owns that bracket: endEncoding + presentDrawable + commit are emitted around the frame body, so the user cannot omit them. House style follows raylib/index.kz and sqlite3/index.kz: `<state!>` grants an obligation, `<!state>` consumes it, bare `<state>` borrows.

Phantom lifecycles

Derived from the phantom labels in the declarations below — state! issues an obligation the compiler will chase, !state discharges it, a bare state holds it without moving it. Nothing here is hand-drawn.

Window 2 states opened!active!
Frame 1 state frame!

window.open

<opened!> index.kz:217

frames

<!opened|!active><frame!><active!> index.kz:341

release.frame

<!frame> index.kz:414

window.close

<!active> index.kz:417

window.clear.color

<opened|active> index.kz:434

draw.triangle

<frame> index.kz:445