by danielvaughn · 2y ago · 0 comments
In theory shouldn't it be possible to create a programming language specifically for UI? Something that can be interfaced with from any major programming language. Kinda like protobuf with its IDL format, but instead of defining data, it's declaring user interfaces. Is that a crazy or stupid idea?
QT and XAML come to mind, but I believe QT is closed source (might be wrong about that), and XAML seems to have been dead in the water for a long time now (also might be wrong about that).
Anyway, there are some languages specifically desgined for making UIs. Qt has one of those, QML[1]. It's a "simple" language made precisely for UI development, that can be wired to C++, allowing you to write business logic in a general language, while keeping UI focused.
More interestingly, though, is Slint[2]. The language (and company behind it) was made by ex-QML devs which sought to improve the design, avoiding some pitfalls that QML ended up running into. It's core is written in Rust, but there are bindings for C++, JS and now Python too. They also have a focus on embedded devices, which ends up translating to always having good performance and memory footprint in mind, which is neat.
One of Slint's dev is ogoffart: https://news.ycombinator.com/user?id=ogoffart
[0]: https://www.qt.io/faq/tag/qt-open-source-licensing [1]: https://en.wikipedia.org/wiki/QML [2]: https://slint.dev
There is support and growing popularity for declarative UI defined in C#[3] and F#[4] instead though.
[0]: https://docs.avaloniaui.net/docs/basics/user-interface/intro...
[1]: https://platform.uno/docs/articles/getting-started/counterap...
[2]: https://learn.microsoft.com/en-us/dotnet/maui/xaml/fundament...
[3]: https://github.com/AvaloniaUI/Avalonia.Markup.Declarative
1) Types on the left
2) Statement, not expression, based
3) No privacy modifiers (aka, underscores everywhere)
4) required semicolons
5) no language support for json (de)serialization, or, json boilerplate everywhere (yikes)
I've tried to get into Flutter 3x now, and each time Dart has defeated me.
Flutter is quite good though, so take the good with the bad, I just can't stomach Dart (yet).