Egui slaps and is clearly going places.
Egui slaps and is clearly going places.
I've run it before. I know what it looks like.
I use egui. It's OK. But you have to code up all your dialog boxes in Rust. This is misery if you have fifty dialog boxes and widgets you need. The widget library is weak and the themes are poor. I don't care, because I'm doing a metaverse client, and all the visuals are in the 3D image. The 2D GUI on top is minimal, as is normal for games. So minimal that it disappears completely, like YouTube controls, when you're not using it, to give you a clean 3D world.
(Egui hint: don't use bottom-up layout. Always work top-down, left to right. Egui layout is one pass, and while it tries to look ahead, it's not good at it.)
It's certainly nice to work with from a developer's perspective, what could be easier than
if ui.button("Say hello").clicked() {
println!("Hello!");
]
?But it's quite a pain to style if you're particular about typography and pixel-perfect layouts. Between styling an egui app and styling something with CSS (or some flexbox/grid system), I'll take CSS every time.
Still looking forward to how Xilem turns out, and what people build on top of that.
https://github.com/leptos-rs/leptos
These are already orders of magnitude faster than React, and as the WASM<->DOM bridge improves, they will only get faster.
Sycamore:
https://github.com/sycamore-rs/sycamore
https://sycamore-rs.netlify.app/examples/todomvc/#
Dioxus:
In about 3-5 years these frameworks will start to consolidate and reach maturity.
It's already possible to build reactive isomorphic apps in Rust.
If you haven't checked out Actix/Axum, it feels a lot like Python/Flask. The ecosystem is coming along quickly.
Next I clicked on the combo box, it opens the dropdown, and I try to use arrow keys to navigate it. That doesn't work. Is that because I opened it using the mouse? Nope, still doesn't work if you tab through the widgets and use Enter to open. Looking up items by typing the first few characters doesn't work, either.
This is all really basic stuff that native widgets offer to any app for free on any platform.
Electron builds native software by embedding a web browser and using the browser's layout engine and DOM. Canvas based rendering like this is the inverse. Here the application discards the browser's layout engine and DOM, and instead embeds its own layout engine. - Despite the browser being right there and available.
Hilariously, in a demo like this there's 3 layers of UI controls nested inside each other. First, there's the OS's native UI toolkit. Then there's the browser. The browser discards most of those UI elements, and reimplements its own controls. And then Egui discards all of that and embeds its own, third layout engine all written in wasm. No inertial scrolling. No web inspector. No native controls (especially a problem on iOS or android). No CSS - so I hope Egui's layout engine supports the layout you're after.
Downside: Its a 5mb wasm bundle. But on the plus side, 5mb is positively tiny compared to shipping electron!
Egui only use wasm in situations where you must use the user browser because you have no choice. Eg: showing a demo of the app on the web without having to install anything.
> Its a 5mb wasm bundle. But on the plus side, 5mb is positively tiny compared to shipping electron
This comparison makes no sense. Situation where electron could be used are exactly the kind of situations where a wasm bundle would not be shipped (a native binary would be shipped instead)
Sure; but given the insane size of shipping chrome, it’s fun seeing a full app complete with widget library, layout engine and text input elements in 5mb. It’s terrible to make websites that big. But if chrome could do all that stuff in only a 5mb binary then I’d be much happier with electron.
If you didn’t catch it, the wasm bundle is running in a 32mb memory slab. Positively slim by the standards of modern gui apps!