logoalt Hacker News

Xilem – An experimental Rust native UI framework

131 pointsby Levitatingyesterday at 11:36 PM73 commentsview on HN

Comments

sandreastoday at 5:27 PM

While I love seeing many alternatives regarding UI frameworks, I'd love to see one general purpose "market leader".

I love `iced` for its simplicity and flexibility, but unfortunately there is no official software renderer, which makes it impossible to use for my little embedded side project.

`Slint` is also usable, however I'm not sure about the licensing approach that makes you pay for non open source projects (which is totally understandable, but somehow this feels like a no-go for the "leading" UI framework). The Slint UI DSL feels very good at first, but the more you use it, the more you run into limitations like missing async support for callbacks, the lack of importing structs from Rust into and export UI structs to Rust, etc. However, it at least supports a software renderer and framebuffer.

Is there any other lightweight UI Framework supporting software-rendering and framebuffer for embedded devices (RISC-V 64bit musl, LicheeRV Nano)?

alfanicktoday at 10:31 AM

What's native about it? It seems like custom GPU rendered thingy with nothing "native".

Linux GUI frameworks are hot potato, I tried to write "native-feeling" app with taskbar icon lately on Linux (Cinnamon), intuition says GTK3, Internet says GTK4. Cinnamon says write it in JS and plug it in as an applet. Qt seems like the most complete GUI framework, but I don't like KDE (and Qt on mostly GTK based env looks weird). Windows is the same, Microsoft has like 10 different UI frameworks from different epochs. MacOS seems to be the only one with some common UI framework.

show 3 replies
malekpourtoday at 5:13 AM

I've done a small project with Dioxus on Blitz. It is principally very close to Xilem and in fact is using some of the Xilem components. https://github.com/DioxusLabs/blitz

show 1 reply
mellosoulstoday at 10:36 AM

Are we GUI Yet? The state of building user interfaces in Rust.

https://areweguiyet.com/

show 1 reply
sheepscreektoday at 1:25 AM

Been using it with mixed success. While I love vello, Xilem is less mature in comparison. Many standard UI components, such as selection box, are not implemented yet. On the other hand, it’s a great opportunity to become a contributor towards a genuinely useful and promising project!

Levitatingtoday at 2:06 PM

If you want to learn more about Xilem's architecture I recommend Raph Levien's blogpost: https://raphlinus.github.io/rust/gui/2022/05/07/ui-architect...

brainlesstoday at 3:04 AM

I keep trying Xilem and then egui or Iced. Xilem needs more widgets out of the box to be easy to build with. Slint is another option. I wonder what cross platform GUI framework (from any language) will finally become as common as Electron based apps or the vast number of native OS apps in Windows or macOS or Linux.

I keep going back to Tauri, which is practical to build desktop apps quickly but still uses HTML, CSS, JS to build the UI. You can use Rust web UI tools but then it is still (system) browser based.

show 4 replies
mtndew4brkfsttoday at 1:54 AM

Was there some new developments with this project that renewed interest recently? I started learning Rust in 2018 or 2019 and I think "good Rust GUI" research is probably at least that old.

show 1 reply
creatatoday at 6:23 AM

What's the rationale for using Rust to write a UI? Using a scripting language (or at least a garbage-collected language) is much less restrictive, and it's not like the "what goes where" UI code is especially performance-sensitive.

show 6 replies
wiz21ctoday at 12:54 PM

Tested egui and it's great provided you accept the "immediate mode" and its limitations. It's quite polished nowadays although it misses in some areas.

amaranttoday at 5:06 AM

Given the similarity in "inspired by" projects, how does this compare to iced? I've found iced to be surprisingly mature in every aspect I've tried, except the documentation, which is severely lacking

pointlessonetoday at 8:07 AM

I’d wager that it’s as native as Electron. It might be faster, sure, but it’s not native to any platform.

show 3 replies
_stillmindtoday at 3:41 AM

Why not just use Flutter with Rust, via the flutter_rust_bridge (https://cjycode.com/flutter_rust_bridge/quickstart)? Seems like a reasonable combo to me.

show 1 reply
wangiitoday at 11:07 AM

what's the difference between Xilem and GPUI? GPUI is used in zed and pretty cool!

show 2 replies
ameliustoday at 9:12 AM

Can it render SVG with all of its features? (Does it support all modern 2D drawing primitives)

show 1 reply
evikstoday at 3:35 AM

Is there a plan for this to compete the experiment any time (soon)?

CapricornNobletoday at 5:12 AM

Why should I try to learn this instead of Slint?

show 2 replies
sourcegrifttoday at 3:08 AM

Very happy with qmetaobject-rs. Qt is tried and tested, dnd multi platform. Also, UI itself is best done declaratively not imperatively. Qmetaobject-rs gives you the best of both worlds: great UI declaratively, logic in Rust.

show 1 reply
Serhii-Settoday at 1:04 PM

[dead]