Live data from Hacker News

Show HN: A Modern GUI Library for Ada: CSS Styling, XML UI, SDL3

github.com

11–20 of 28 posts

Re: Show HN: A Modern GUI Library for Ada: CSS Styling, XML UI, SDL3

#11

Why would anyone choose XML for a modern GUI layout in 2026? That seems like a mis-step.

Author here, the library itself is pure Ada, the XML UI is just a convenience layer on top of it, there is a code generator that picks it and writes ada packages. happy to hear better alternatives!

I'd recommend ASN.1 for almost everything that XML is used for. Unfortunately, is a [semi-] human-readable file is in your list of 'needs', then that is "mostly" ruled out.

(So, what you could do is use the XML-encoding of ASN.1, and then use _that_ in the place of your (current) XML, and then simply allow eg DER encoded objects.)

Re: Show HN: A Modern GUI Library for Ada: CSS Styling, XML UI, SDL3

#12
post #7

There's so much repetition in there. E.g.: (adi-json.adb) if not W.After_Key (W.Depth) then -- things else W.After_Key (W.Depth) := False; end if; -- ...more things... W.After_Key (W.Depth) := False; And what's the deal with those filenames? If you replace adi- with TIMMEH, you'll see what I mean. Code should be more DRY (don't repeat yourself).

I agree on the repetitions those need cleanup. Regarding filenames, it is a GNAT convention (the GCC's ada compiler) where we need to have the package name on it separated by -

Ada has some excellent GENERICs, you can use them to great effect for reducing code-size.

Re: Show HN: A Modern GUI Library for Ada: CSS Styling, XML UI, SDL3

#13
Cool project. Good idea to use SDL3; it brings along much more than SDL2 where you had to use a lot of other libraries to become platform independent with all features. The disadvantage might be that SDL3 itself (as SLD2) is pretty big. Ada got a bit out of fashion (unfortunately) but it's still an impressive, excellent language. Still an interesting choice. Maybe you can give more information about your choice and plans with the GUI library.

Re: Show HN: A Modern GUI Library for Ada: CSS Styling, XML UI, SDL3

#14
post #13

Cool project. Good idea to use SDL3; it brings along much more than SDL2 where you had to use a lot of other libraries to become platform independent with all features. The disadvantage might be that SDL3 itself (as SLD2) is pretty big. Ada got a bit out of fashion (unfortunately) but it's still an impressive, excellent language. Still an interesting choice. Maybe you can give more information about your choice and p…

Thanks!

You can watch the talk at Ada Developers Workshop Vasteras 2026, where I explain some of your questions:

https://www.youtube.com/watch?v=d-RISfK9Sy8

I should write more details in the repo's README file.

Basically, I was quite frustrated with the available solutions vs. my requirements and ended up making my own, and this process took me many years.

Ada is a language that I always admired, but at the time I didn't feel comfortable depending on the available open-source toolchains. GNAT has actually been open source for decades, but a few years ago, with the increasingly accessible FSF GNAT ecosystem, things changed dramatically.

I think people in the embedded world should really consider Ada/SPARK, where you can formally prove program correctness in Ada itself, going much beyond simple memory safety. Also, Ada's mapping of records directly to registers with bit and read/write semantics granularity is unbeatable. I could go on, but plenty of information is readily available online. BTW, I still consider myself a beginner in Ada; I'm perhaps leveraging 10% of its potential. I really recommend giving Ada (or yourself) a chance.

Why not Rust? I considered it, but dropping support for versions earlier than Windows 10 scared me away. It is not an option for my use case, where industrial customers have old operating systems.

SDL3 was a perfect fit as a backend since it abstracts away the hardware perfectly and allows me to focus on my own business. It remains to be seen whether I can abstract it away and let the user choose the backend. I use as few features as I can; for example, for rendering, I use the good old SDL_Renderer API, which does not require specific GPU drivers or features and falls back nicely to software rendering. Drop shadows are simply software-rendered and cached; the same applies to SVG images and Lottie animations. In this way, I simplified the requirements a lot. Then the SDL3_ttf was god send for text.

Re: Show HN: A Modern GUI Library for Ada: CSS Styling, XML UI, SDL3

#15

Why would anyone choose XML for a modern GUI layout in 2026? That seems like a mis-step.

Author here, the library itself is pure Ada, the XML UI is just a convenience layer on top of it, there is a code generator that picks it and writes ada packages. happy to hear better alternatives!

I suppose it depends what audience will be editing it. XUL used it because that was the fashion at the time, but it wouldn't be something I'd want to hand edit. Qt used its own QWT (now dated) which was a lot easier for a human to edit, albeit a bit ad-hoc.

If it's mostly consumed and edited by a machine/LLM, xml might actually be ok. Otherwise, I think something a bit less ceremonial. Obviously there's lots of options, and I imagine you may even miss much of the tooling of XML (schemas and such).

Kind of a drive-by comment, I admit, but it just struck me as a little surprising.

Also: it's been some 3 decades since I was playing with Ada ... very cool to see it getting some GUI love!

Re: Show HN: A Modern GUI Library for Ada: CSS Styling, XML UI, SDL3

#16
Looks great!

I was particularly impressed by the following:

>"A built-in lightweight HTML view widget renders documentation-style markup with cascading styles."

Basically you built a miniature, integrated, embedded, open-source web browser which can parse CSS and render to SDL... very impressive!:

https://github.com/ovenpasta/adi2/blob/master/src/adi-widget...

https://github.com/ovenpasta/adi2/blob/master/src/adi-widget...

Also, it should be possible to easily, easily port this source code to Delphi and/or FreePascal and/or Graeme Geldenhuys' "Blaise" language (A modern, self-hosting Object Pascal compiler, https://github.com/graemeg/blaise) should anyone in those respective communities decide to do that...

Also, if Ada had an {$IFDEF} equivalent, then with proper use of {$IFDEF's} (since the source code is so similar across these language families), the source code could potentially support all of the above languages from a single source code base...

But, of course, maybe that wouldn't be desired... maybe individual ports would serve those other communities better... and then again, maybe it wouldn't!

(Just thinking aloud... :-) )

Anyway, great work, and once again, very impressed by the lightweight HTML view widget!

Re: Show HN: A Modern GUI Library for Ada: CSS Styling, XML UI, SDL3

#17

Looks great! I was particularly impressed by the following: >"A built-in lightweight HTML view widget renders documentation-style markup with cascading styles." Basically you built a miniature, integrated, embedded, open-source web browser which can parse CSS and render to SDL... very impressive!: https://github.com/ovenpasta/adi2/blob/master/src/adi-widget... https://github.com/ovenpasta/adi2/blob/master/src/adi-wid…

> Basically you built a miniature, integrated, embedded, open-source web browser which can parse CSS and render to SDL... very impressive!:

Modern LLMs are indeed impressive.

Re: Show HN: A Modern GUI Library for Ada: CSS Styling, XML UI, SDL3

#18

Earlier quoted context omitted.

Author here, the library itself is pure Ada, the XML UI is just a convenience layer on top of it, there is a code generator that picks it and writes ada packages. happy to hear better alternatives!

I suppose it depends what audience will be editing it. XUL used it because that was the fashion at the time, but it wouldn't be something I'd want to hand edit. Qt used its own QWT (now dated) which was a lot easier for a human to edit, albeit a bit ad-hoc. If it's mostly consumed and edited by a machine/LLM, xml might actually be ok. Otherwise, I think something a bit less ceremonial. Obviously there's lots of optio…

Came here to comment on it being fascinating how xml has survived here and thrives on this front. Even in react syntax, in some sense. Natural fit?

As happy user of qt desktop framework, not sure in what sense it’s dated.

Not sure how qwt relates to this tho? https://qwt.sourceforge.io/

Making coherent ux with it still seems much easier than in qml, it has the right constraints and visual editing it is reasonably lightweight, unlike qml studio. Of course it has its flaws too but UX wise it is still hard to find an equally mature cross platform toolkit.

Re: Show HN: A Modern GUI Library for Ada: CSS Styling, XML UI, SDL3

#20

Looks great! I was particularly impressed by the following: >"A built-in lightweight HTML view widget renders documentation-style markup with cascading styles." Basically you built a miniature, integrated, embedded, open-source web browser which can parse CSS and render to SDL... very impressive!: https://github.com/ovenpasta/adi2/blob/master/src/adi-widget... https://github.com/ovenpasta/adi2/blob/master/src/adi-wid…

Thanks! The real work is done in the Adi2 widget engine.

Take a look at: https://github.com/ovenpasta/adi2/blob/master/src/adi-widget... https://github.com/ovenpasta/adi2/blob/master/src/adi-layout... https://github.com/ovenpasta/adi2/blob/master/src/adi-css_st...

Regarding Pascal... yes you would need to rewrite everything I guess, Ada looks similar but it is quite different. Welcome!

Post reply on HN