Live data from Hacker News

Emerging Rust GUI libraries in a WASM world

monadical.com

1–10 of 272 posts

Re: Emerging Rust GUI libraries in a WASM world

#2
I've been building a profiler UI in egui recently, and have been pretty happy with it. I didn't try out all of the options in this article (there are rather a lot of them), but I did try several, and out of the ones I tried, egui was by far the highest performance. Since my goal is to shove as many rectangles onto the screen as possible, this was the killer feature for me, but it was also nice that it did most of the other GUI stuff I needed.

WASM demo here if you want to see it (with dummy, and not particularly realistic, profiling data): https://elliottslaughter.github.io/legion-prof-viewer/

For comparison, the UI I'm replacing falls down with about 16 nodes worth of data. (The demo has 8192 "nodes" worth of fake data.)

Re: Emerging Rust GUI libraries in a WASM world

#4
> GUI in Rust progresses with unprecedented speed – 3 months in Rust GUI-land is like 3 years in the mortal world.

areweguiyet.rs was started almost exactly 5 years ago. That means it's been about 60 mortal years and we still don't have a definitive solution to GUIs.

Re: Emerging Rust GUI libraries in a WASM world

#5
post #4

> GUI in Rust progresses with unprecedented speed – 3 months in Rust GUI-land is like 3 years in the mortal world. areweguiyet.rs was started almost exactly 5 years ago. That means it's been about 60 mortal years and we still don't have a definitive solution to GUIs.

That's because Rust GUI people are like Lispers and functional programmers — too obsessed with doing things correctly "from first principles" and "purity". For GUI programming, there is only one feature that matters: having a fuck ton of well supported widgets for every situation across every platform. Almost everything else is secondary. This is why HTML/CSS, Flutter (and to a lesser extent Qt) are so successful. No end user cares about data mutational elegance when at the end of the day, somebody has to do the unsexy work to maintain and support each individual button, scrollbar, and toggle.

Re: Emerging Rust GUI libraries in a WASM world

#6
Searched for “accessibility” — 0 results (I couldn’t see anything skimming down the page).

Speaking as a Rust user, everyone in Rust land loves insulting Electron, but they have put some solid work into accessibility. In particular, using WASM to draw text with webgl or canvas, instead of DOM, may in the long term be one of the biggest steps back in accessibility ever.

Re: Emerging Rust GUI libraries in a WASM world

#8

Searched for “accessibility” — 0 results (I couldn’t see anything skimming down the page). Speaking as a Rust user, everyone in Rust land loves insulting Electron, but they have put some solid work into accessibility. In particular, using WASM to draw text with webgl or canvas, instead of DOM, may in the long term be one of the biggest steps back in accessibility ever.

I'm not familiar with the entire ecosystem but at least egui offers accessibility via AccessKit

Re: Emerging Rust GUI libraries in a WASM world

#9
post #4

> GUI in Rust progresses with unprecedented speed – 3 months in Rust GUI-land is like 3 years in the mortal world. areweguiyet.rs was started almost exactly 5 years ago. That means it's been about 60 mortal years and we still don't have a definitive solution to GUIs.

That's because Rust GUI people are like Lispers and functional programmers — too obsessed with doing things correctly "from first principles" and "purity". For GUI programming, there is only one feature that matters: having a fuck ton of well supported widgets for every situation across every platform. Almost everything else is secondary. This is why HTML/CSS, Flutter (and to a lesser extent Qt) are so successful. No…

I'd argue that the most successful UI platform is a browser.

And guess what? Browser does not have a fuck ton of well supported widgets. All it does it some button with outdated UI, few inputs nobody really uses and dropdown select suitable only for the most basic uses.

Anything other built on divs with CSS and JS.

And it works.

So my opinion is that it's definitely solid foundations what matters. Rest will come with time from third party libraries.

Re: Emerging Rust GUI libraries in a WASM world

#10

I wonder if WebGPU could help with app GUI. I tried to understand how does it work but it seems it's all about triangles, so it's not really clear if it has any benefit over plain Canvas for standard UI approaches.

Please don't use canvas or webgpu for GUI unless it's a game or other interactive experiment. Webgpu will drop compatibility with hardware and no accessibility, you would have to build everything up from ground again that web browsers already offer with DOM like flutter does by having "overlay DOM" on top of canvas to provide accessibility, and it's kinda janky. Now that's out of the way, sure you can do GUI with webgpu, see for example IMGUI or NanoGUI (NanoVG based).
Post reply on HN