// HACKER NEWS — CYBERSECURITY
Show HN: A Modern GUI Library for Ada: CSS Styling, XML UI, SDL3
Adi2 gives you a real widget toolkit with the niceties developers expect from a modern UI stack — CSS-like styling with live reload, declarative XML layouts, animations, SVG and Lottie graphics, internationalization, and asset bundling — implemented natively in Ada on top of SDL3.
Status: in production use, but not yet a stable release — APIs may still change between versions.
A release build links statically into a single executable under 10 MB —
the widget toolkit, the CSS engine, SVG and Lottie rendering, all of it.
Whatever assets you bundle add their own weight to that.
It draws through SDL's renderer, which binds to whatever the host offers:
Direct3D on Windows, Metal on macOS, Vulkan or OpenGL where they exist,
software as the floor. Windows XP takes Direct3D 9 and a current Mac takes
Metal, from the same source.
Sizes are for a minimal application; yours grows with your own code and
assets. Each of the others buys its size with a large ecosystem and years
of production use — the trade Adi2 offers is a single file you can hand to
someone, on hardware the others have moved past.
Full gallery of every example: docs/gallery.md. Or run them yourself, in the browser: live demos.
The toolchain emits a typed Ada package you instantiate from your main — see examples/hello_example.adb for the full ~25-line program.
The CSS rule above is just an aggregate. The XML widget tree is just a few constructor calls. Both paths land on the same API — see examples/hello_raw_example.adb for the full equivalent program. The shape of the styling code is:
To use Adi2 from your own project, with "adi.gpr" — SDL linker options come with it. The library's public specs use Ada 2022 constructs, so units that with Adi.* packages need pragma Ada_2022; or -gnat2022.
Starting your own project? docs/getting_started.md walks from an empty directory to a working window, in XML/CSS and again in plain Ada.