Live data from Hacker News

I Switched from Flutter and Rust to Rust and Egui

jdiaz97.github.io

61–70 of 148 posts

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

#61
post #56

Earlier quoted context omitted.

A virtual DOM is another indirection, so the opposite of what immediate mode tries to accomplish.

Immediate mode only describes the interface.

Does it?

I had the impression that the lack of double buffering would imply a more direct access, this the "immediate" in the name.

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

#62
post #20

Earlier quoted context omitted.

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.)

That's not true, it only re-renders if there's an input event or an animation running. This is very easy to see if you just put a `println!` in your UI logic.

This is also mentioned in the gui docs here https://github.com/emilk/egui#why-immediate-mode:

> egui only repaints when there is interaction (e.g. mouse movement) or an animation, so if your app is idle, no CPU is wasted.

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

#63
post #20

Earlier quoted context omitted.

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.)

There are two modes, reactive and continuous. You can switch between them here in the backend tab:

https://www.egui.rs/

Reactive mode is the one you are looking for.

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

#64
post #53
post #51

Earlier quoted context omitted.

Have you considered just using gRPC in this case? You gain 100% language separation (no FFI) and remote client/server at the cost of a little more call overhead.

Not OP but in same situation. Not every platform can run gRPC over localhost easily or without extra privileges. I used to use protobuf but now I just use JSON, over stdin/stdout on desktop. It’s honestly quite good.

Which platforms? My product runs gRPC client/server on macOS, Linux and Windows. No issues with privileges. Or are you trying to run it on port 443? Yeah, don't do that, run it on 8443 or whatever instead.

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

#65

Earlier quoted context omitted.

Since others are sharing Rust GUI libraries, I’ll mention Slint [ https://slint.rs ] a native GUI toolkit written Rust. It has a declarative domain specific languages, editor tools, and has been stable with no breaking API changes since 2023. I'm one of the developers.

Anyone considering it will need to decide for themselves how to feel about it, but I think it's important to prospective users to highlight that the current licensing model for Slint requires either GPL3-compatible licensing of your work, advertising for Slint within your own software, or paying ongoing licensing fees and/or royalties. https://github.com/slint-ui/slint/blob/master/FAQ.md#licensi... I only mention thi…

I really like this model of ”GPL3, but commercial licenses available”. Means you can have a sustainable business without sacrificing open source. I wish it was more widespread, the prevalence of extremely permissive licenses has led to so many enormous companies using open source without giving back.

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

#66
post #55
post #53

Earlier quoted context omitted.

Not OP but in same situation. Not every platform can run gRPC over localhost easily or without extra privileges. I used to use protobuf but now I just use JSON, over stdin/stdout on desktop. It’s honestly quite good.

Why not ConnectRPC? It's basically gRPC but without all the strange requirements for exotic HTTP features.

I actually use this currently. Not nearly as many platforms, but you an always fallback to gRPC.

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

#69
> That didn't happen, so the Flutter capabilities were very underused. > I didn't even make an effort to make it look good

Makes sense to use a primitive instrument to satisfy primitive needs, those eschewing a lot of extra complexity.

Though if some funding does fall through for better gui, isn't that a risk of having to do another switch?

Post reply on HN