HeadlinesBriefing favicon HeadlinesBriefing.com

Adi2: Modern Ada GUI Library with CSS, XML, SDL3

Hacker News •
×

Adi2 is a modern GUI library for Ada providing a native widget toolkit with CSS-like styling, declarative XML layouts, animations, SVG and Lottie graphics, internationalization, and asset bundling — all implemented on SDL3. Currently in production use but not yet a stable release, APIs may change between versions.

Style UIs with familiar CSS syntax including selectors, pseudo-classes, transitions, gradients, and box shadows. Edit CSS files and see changes instantly with live reload — no recompile needed during development. Alternatively, write styles as plain Ada aggregates. Describe interfaces declaratively in XML (<button>, <grid>, <text-editor>) with toolchain-generated Ada packages, or construct widget trees directly in Ada using handle-based builders.

Render rich content via a lightweight HTML view widget, raster images through SDL3_image, SVG via bundled plutosvg, and Lottie animations via bundled rlottie. Bundle all assets (CSS, fonts, images, translations, SVG sprites) into a single executable with no runtime filesystem dependencies. Gettext-compatible i18n supports plural forms and automatic locale detection. CSS transitions animate properties like color, opacity, and transforms automatically.

A release build links statically into a single executable under 10 MB. It draws through SDL's renderer (Direct3D on Windows, Metal on macOS, Vulkan/OpenGL elsewhere, software fallback) and runs on Windows XP+, macOS, Linux, and WebAssembly via GNAT-LLVM and Emscripten. A development-only MCP bridge enables AI-assisted testing and automation.