logoalt Hacker News

scrivanodevlast Tuesday at 9:13 PM1 replyview on HN

QML is a great language to make GUIs. A few years ago I tried XAML, and it honestly kind of sucked in comparison (the verbosity alone made it painful to work with). I haven't tried Slint UI, but supposedly their DSL is even better since it fully compiles to native Rust code.


Replies

IshKebablast Tuesday at 9:37 PM

I found QML to be a terrible language for making GUIs. I really tried with it. But it just felt so hacky and unfinished. A couple of examples (from like 10 years ago so forgive me if I got some of the details a bit wrong):

1. Child components can magically refer to variables in their parents. This is basic encapsulation 101. The only other language I know of that allows that is SystemVerilog and that's from an era where people didn't know better (especially hardware guys).

2. You can create custom widgets... but they can't display text! There's a class called something like QmlSceneGraphTextNode that is the way that all the provided widgets display text but it's private. I guess they might have fixed this eventually but it stayed private for the ~5 years I tried to use it. They wanted me to just use Label widgets in QML land which sucks.

It also felt like there was a pretty huge impedance mismatch between QML and C++ due to its use of Javascript. E.g. stuff like using 64-bit integers. That reminds me:

3. It uses Javascript.

4. I never found a good way to use dialogs. They seem to push you towards having all possible dialogs exist all the time and just showing and hiding them, which is kind of crazy.

I don't think the idea of a GUI DSL is fundamentally bad, but QML is certainly a pretty miserable implementation. Hopefully the Slint guys have learned all of these lessons.

show 1 reply