A modular, GPU-first UI stack in C++, built for AI agents as much as for humans.
- Layers you can swap. Host, Graphics and Toolkit are separate packages. Use all three, replace one, or skip the toolkit and paint directly.
- One scene graph. The renderer, hit testing and accessibility walk the same tree. UI blocks, raw paint and native views mix in one frame.
- Real materials. Liquid glass, frosted backdrops, liquid metal, water, drop shadows, glow and blend modes run on every backend.
- Same pixels everywhere. Metal, Vulkan, WebGPU and a CPU rasterizer share one compositor, and golden tests pin the output.
An agent can build a Glim app, run it, see it, measure it and fix it without extra tooling. Every app ships the same headless interface:
- See:
--snapshotrenders a frame to PNG, so an agent can look at what it built. - Read:
--dump-a11yprints the UI as text, and--dump-opssaves the recorded op stream so two frames can be compared byte for byte. - Drive:
--e2etaps, presses keys, scrolls, steps time and asserts text, and--proberuns an interactive session over stdin. - Measure:
--stats,--trace-frameswith a Chrome trace,--soakfor op growth and--drivefor live input latency.
Humans get the same loop: these flags are the profiler, the test runner and the screenshot tool, and they run in CI as plain tests.
![]() |
Infotainment: a flying-EV cockpit. Glass gauges, glow and a live 3D city map under frosted cards. pnpm exec nx run infotainment:run |
![]() |
Smart home: a glass dashboard over a villa photo. The theme switch turns day into dusk, and the house lights follow the dimmer. pnpm exec nx run smarthome:run |
![]() |
Glass: the lens materials side by side. Clear and frosted glass, merging pills, liquid metal and water. pnpm exec nx run glass:run |
Effects are tags on any block. Custom elements paint the same effects through their sink, and both mix in one tree.
#include <glim/toolkit.h>
#include <glim/toolkit/host/Host.h>
using namespace glim::toolkit;
Block card() {
return column(
glass({.radius = 16}),
shadow({.sigma = 16.f, .offsetY = 8.f}),
effectGlow({.radius = 12, .color = 0xff7a3dffu, .intensity = 0.6f}),
pad(20),
lines("Glass, shadow and glow are tags.")
);
}
int main() {
return host::run({.title = "Hello Glim", .width = 480, .height = 320}, [](const Engine&) {
return column(pad(32), gap(16), lines("Hello, Glim"), card());
});
} Toolkit glim-toolkit, glim-toolkit-host blocks, state, layout, animation, a11y
│
Graphics glim-paint, glim-gpu-* scene, merge, isolate, glass, CPU raster
│
Host glim-shell-*, glim-embed window, vsync, input, native views
| Platform | Shell | GPU |
|---|---|---|
| macOS, iOS, tvOS | AppKit, UIKit | Metal |
| Android (phone, TV, AAOS) | NativeActivity | Vulkan |
| Linux | Wayland | Vulkan |
| Web | Emscripten | WebGPU |
| Anywhere | any | CPU rasterizer |
Glim also embeds. A sandboxed guest, such as WASM or an out-of-process UI, encodes one frame packet per vsync, and the native host submits it while keeping its own swapchain and run loop.
pnpm install
pnpm test
pnpm exec nx run smarthome:runEvery app takes the same headless flags:
glim-smarthome --snapshot out.png # see a frame
glim-smarthome --dump-a11y # read the UI as text
glim-smarthome --e2e "~Glim Home;tap:i:5;step:0.5" # drive and assert
glim-smarthome --trace-frames 20 --trace-json trace.json # profile in Perfetto
glim-smarthome --soak 20 --stats # check for op growth
glim-smarthome --drive examples/smarthome/drive/controls.drive # live latency reportPrerequisites: Node 24, pnpm 9.15 (pnpm install), CMake 3.22+ and Ninja.
- Apple: Xcode with the Metal toolchain (
xcodebuild -downloadComponent MetalToolchainifxcrun metalis missing). - Android: Android SDK and NDK (
android-*presets). - Web: Emscripten (
web-webgpu-debugpreset; wipebuild/after upgrading it) and Chrome. - Linux:
ninja-build pkg-config libwayland-dev wayland-protocols libvulkan-dev zlib1g-dev glslang-tools. - Coverage: gcovr;
pnpm coveragefails below the floors intools/coverage-baseline.json.
- CMake: install a configured preset and
find_package(glim). See tests/package. - Xcode:
pnpm xcframeworkbuilds a Swift package. See apple. - Gradle:
pnpm aarbuilds a prefab AAR. See android. - Web:
pnpm web-packpacks@glim/webintobuild/web-pack/glim-web.tgz(publishing is a dry run). See packages/glim-web.
Frame-rate limits, crash reports and symbolization are in packages/glim-toolkit-host. Versioning and what counts as public API are in the changelog.
Glim is maintained as a closed-contribution project. Pull requests are not accepted and will be closed without review. Bug reports and questions are welcome as issues, though a response is not guaranteed.


