Live data from Hacker News

I Switched from Flutter and Rust to Rust and Egui

jdiaz97.github.io

11–20 of 148 posts

Re: I Switched from Flutter and Rust to Rust and Egui

#11

Immediate mode GUIs are cool but it seems that accessibility support is somewhat lacking. In native frameworks you often get it for free, on the Web you can follow ARIA and get it for free, but with immediate mode GUIs it seems that it is always a bit of an afterthought. For example, it seems that egui supports AccessKit, but not when used on the Web. With Dear ImGui it seems worse, there is some effort in that direc…

Is there any technical limitation that accessibility support is usually lacking in immediate mode GUIs? Or it's just a lot of work?

Flutter, which does its own rendering of controls, needs to implement a lot of accessibility features by itself.

Re: I Switched from Flutter and Rust to Rust and Egui

#12
> A quick Google search with "flutter setstate is not refreshing" reveals a struggle that you will face quite often when running Flutter. It sounds like an easy fix, but the nature of Flutter using a bunch of nested Widgets creates, naturally, lasagna code that makes it hard to reason about this.

Can you expand on this OP? I've never had problems with `setState` nor "lasagna code" in Flutter. From a quick search I mostly seem to find questions from people who are still learning Flutter and getting basic things wrong.

Re: I Switched from Flutter and Rust to Rust and Egui

#13
post #9

So egui is great for projects where the application runtime is short lived, or for overlays in longer lived projects. The visual equivalent of scripts, where you know you need a small amount of immediate visual feedback and tweaking parameters for it to be useful to the end user. Flutter answers questions about more robust UI. It's good that you chose the right tool for the job and more people should know that there…

If your UI is fast enough, why not in complex UI’s either? I’d say it gives you good motivation to keep your UI handling code as fast as possible.

Doesn't egui always re-render? I like my idle apps to be doing nothing, I don't want them running their render loop in the background

Re: I Switched from Flutter and Rust to Rust and Egui

#14

Immediate mode GUIs are cool but it seems that accessibility support is somewhat lacking. In native frameworks you often get it for free, on the Web you can follow ARIA and get it for free, but with immediate mode GUIs it seems that it is always a bit of an afterthought. For example, it seems that egui supports AccessKit, but not when used on the Web. With Dear ImGui it seems worse, there is some effort in that direc…

Is there any technical limitation that accessibility support is usually lacking in immediate mode GUIs? Or it's just a lot of work? Flutter, which does its own rendering of controls, needs to implement a lot of accessibility features by itself.

'a lot of work' is probably an understatement. one of the reasons everybody embeds browsers nowadays is all the text rendering quirks (e.g. right-to-left) are solved - and some of it includes accessibility (like easy theming, scaling, aria, screen reader support, etc.) browsers spent a lot of resources to make this happen.

Re: I Switched from Flutter and Rust to Rust and Egui

#15
post #13
post #9

Earlier quoted context omitted.

If your UI is fast enough, why not in complex UI’s either? I’d say it gives you good motivation to keep your UI handling code as fast as possible.

Doesn't egui always re-render? I like my idle apps to be doing nothing, I don't want them running their render loop in the background

do you run without a compositor? I get where you're coming from, but 'idle' can mean a lot of different things and redrawing the whole UI at 60hz is not necessarily 'not idle' nowadays.

Re: I Switched from Flutter and Rust to Rust and Egui

#17
post #13
post #9

Earlier quoted context omitted.

If your UI is fast enough, why not in complex UI’s either? I’d say it gives you good motivation to keep your UI handling code as fast as possible.

Doesn't egui always re-render? I like my idle apps to be doing nothing, I don't want them running their render loop in the background

Any quarter decent imgui implementation will idle when there's no input or active animations, and the renderer can generate dirty tiles or rects to unnecessary redrawing -- if it matters, gpus are ridiculously overpowered for drawing a bunch of rectangles. Ui logic is usually firmly in the microseconds realm.

Re: I Switched from Flutter and Rust to Rust and Egui

#18
post #15
post #13

Earlier quoted context omitted.

Doesn't egui always re-render? I like my idle apps to be doing nothing, I don't want them running their render loop in the background

do you run without a compositor? I get where you're coming from, but 'idle' can mean a lot of different things and redrawing the whole UI at 60hz is not necessarily 'not idle' nowadays.

I run with a compositor, which is exactly why it's so great for the application to just draw its window once and then the compositor has the window's contents as a texture. The compositor can do whatever it wants with that texture without involvement from the application.

Re: I Switched from Flutter and Rust to Rust and Egui

#19

So egui is great for projects where the application runtime is short lived, or for overlays in longer lived projects. The visual equivalent of scripts, where you know you need a small amount of immediate visual feedback and tweaking parameters for it to be useful to the end user. Flutter answers questions about more robust UI. It's good that you chose the right tool for the job and more people should know that there…

Both approaches have their downsides and, in my view, retained mode and immediate mode tend to converge as the UI complexity increases. So far, no problems with implementing any UI I want in my experience with egui on a somewhat complicated application (Desktop word processor). Immediate mode is a breath of fresh air from React.

[Edit: although the standard accessibility criticisms apply to my application; although that's more of an issue with my implementation than an indictment of immediate mode generally.]

Re: I Switched from Flutter and Rust to Rust and Egui

#20
post #13

Earlier quoted context omitted.

Doesn't egui always re-render? I like my idle apps to be doing nothing, I don't want them running their render loop in the background

Any quarter decent imgui implementation will idle when there's no input or active animations, and the renderer can generate dirty tiles or rects to unnecessary redrawing -- if it matters, gpus are ridiculously overpowered for drawing a bunch of rectangles. Ui logic is usually firmly in the microseconds realm.

I agree that this is not a necessary downside to immediate mode GUIs, but we're talking about egui specifically here. AFAIK, egui always redraws at some relatively high rate even when nothing is happening. (I'm having trouble finding documentation about what that rate is though.)
Post reply on HN