News for hackers. Stuff that matters.
Re:ZapFast: A fast, native WhatsApp client in Rust and egui by codedokode on Saturday November 07, 2026 @11:50PM (#50410495)
Egui is pretty bad idea. It uses "immediate mode" rendering which means whole window is redrawn on every mouse move. I ran PhotoCraft (built in Rust + egui) in a VM wihout a GPU and the UI felt like it was running on 3 fps.

Egui is definitely not what you want to use on a 4K screen. It is only good for tiny screens of embedded devices.

Why there is no reactive UI that tracks all dependencies and redraws only what needs to be redrawn? (not React, it also re-calculates (but not redraws) everything on every change).

Re:ZapFast: A fast, native WhatsApp client in Rust and egui by fastball on Saturday November 07, 2026 @11:52PM (#50410506)
[delayed]
Re:ZapFast: A fast, native WhatsApp client in Rust and egui by codedokode on Sunday November 08, 2026 @12:05AM (#50410548)
To use memoization you must use immutable structures (otherwise React is unable to detect changes) which are a pain to use and are slow if not designed properly. Do not believe me, try designing for example an algorithm that accepts a huge immutable sorted list with keys, a large sorted list of bulk deletes/inserts and produces a new sorted list with minimum operations. I made 2 or 3 prototypes and they still are not good and not even working properly.

In my book, a good UI framework simply attaches to a mutable model made of arbitrary objects, detect changes and displays it with minimum number of operations. Doesn't require to use any proxies or immutable data or store data in components. Shouldn't be difficult. Why nobody made it, I do not understand.

Re:ZapFast: A fast, native WhatsApp client in Rust and egui by asdf88990 on Sunday November 08, 2026 @12:27AM (#50410656)
This is incorrect. You don’t need to use immutable structures to have stable references which is what matters.

Use context liberally instead of plumbing things through prop’s needlessly and you’re halfway there.

Re:ZapFast: A fast, native WhatsApp client in Rust and egui by rtpg on Sunday November 08, 2026 @02:40AM (#50411190)
React isn't immediate mode by my understanding.

In my head it's retained mode + the diffing layer, which sounds the same but if you try to write an "immediate-mode" API (say, using hooks) in React you'll find yourself churning a lot.

At least unless you use the magic React compiler that memo-izes everything correctly.

Re:ZapFast: A fast, native WhatsApp client in Rust and egui by LoganDark on Sunday November 08, 2026 @12:31AM (#50410677)
> Why there is no reactive UI that tracks all dependencies and redraws only what needs to be redrawn?

Nowadays the focus seems to be on video game-style interfaces that redraw every frame. The justification for this is typically that computers are so fast they can now come up with the entire interface every frame, so why not take advantage of that and forget all this retained-mode complexity?

They don't realize that this is a classic case of the developer's machine fallacy, where the developer has a machine so vastly more powerful than any of their users' that they produce a terrible experience for said users. This is also why games these days typically require upscaling even on 5090, because developers usually have that or something even more powerful and they think the bleeding edge is pushing even THAT machine to its knees.

Developers should be testing their software on the most entry-level, bottom of the barrel Chromebooks from 2015, running the heaviest and most bloated operating system they can think of. If people still optimized their software for that, then maybe computers would still feel almost as fast as the Apple II from 1977.

https://danluu.com/input-lag/

Re:ZapFast: A fast, native WhatsApp client in Rust and egui by codedokode on Sunday November 08, 2026 @12:36AM (#50410703)
And obviously all computers have infinite capacity batteries to maintain game-level power consumption.
Re:ZapFast: A fast, native WhatsApp client in Rust and egui by rixed on Sunday November 08, 2026 @02:09AM (#50411084)
[delayed]
Re:ZapFast: A fast, native WhatsApp client in Rust and egui by LoganDark on Sunday November 08, 2026 @02:09AM (#50411085)
That's actually a very good point, I haven't seen any care for power consumption from software developers in many many years. The only people who seem to still care about it are hardware developers like Valve and Apple.

I figure that doing less work generally requires less power, but some developers are crazy and act like they own the whole CPU, generate tons of heat, stress out the cooling system etc. with multithreaded bullshit when they did NOT need to be multithreaded.

Re:ZapFast: A fast, native WhatsApp client in Rust and egui by proneb1rd on Sunday November 08, 2026 @03:54AM (#50411524)
Not sure why multi threading is a victim. It really depends.
Re:ZapFast: A fast, native WhatsApp client in Rust and egui by LoganDark on Sunday November 08, 2026 @04:43AM (#50411762)
It does indeed depend.

Some multithreaded workloads will use the full logical processor count to pin every core and that can really suck on low-end systems. I think aside from balancing multithreading overhead, this is one of the reasons why some more advanced software (such as 7-Zip) lets you select the number of threads to use for a workload, even if you already know and accept that it'll be expensive until it's completed.

Lots of multithreading things I come across as a developer have a default of something like 4 threads, or only use a certain fraction of logical cores up to a certain maximum, etc. because it's generally more polite not to always pin every core.

Re:ZapFast: A fast, native WhatsApp client in Rust and egui by SkiFire13 on Sunday November 08, 2026 @05:55AM (#50412144)
Depending on what you're doing GPU accelerated rendering is more battery friendly than CPU rendering though.
Re:ZapFast: A fast, native WhatsApp client in Rust and egui by LoganDark on Sunday November 08, 2026 @05:59AM (#50412165)
Drawing the entire interface is more expensive than drawing only what changed, though. You don't have to give up the GPU for that.
Re:ZapFast: A fast, native WhatsApp client in Rust and egui by sexy_seedbox on Sunday November 08, 2026 @01:02AM (#50410810)
PDFCraft works fine for me on a 4k screen connected to an older laptop with an integrated Intel graphics card, blazing fast and smooth.
Re:ZapFast: A fast, native WhatsApp client in Rust and egui by txdv on Sunday November 08, 2026 @02:42AM (#50411201)
I am using it on a 2017 intel macbook and its faster than anything else on that device
Re:ZapFast: A fast, native WhatsApp client in Rust and egui by ozgrakkurt on Sunday November 08, 2026 @01:45AM (#50410986)
What is the argument here?

Basically every device has a GPU.

Why is it bad on 4K?

Did you measure anything in a real setup?

Re:ZapFast: A fast, native WhatsApp client in Rust and egui by Barrin92 on Sunday November 08, 2026 @01:49AM (#50411001)
>What is the argument here?

it's an incredible waste of resources, especially at high resolutions, to redraw a Gui application like you would a videogame

Re:ZapFast: A fast, native WhatsApp client in Rust and egui by piker on Sunday November 08, 2026 @04:45AM (#50411776)
You only redraw when there’s interaction. In exchange you use basically no memory for state retention which frees up the real resource constraint.
Re:ZapFast: A fast, native WhatsApp client in Rust and egui by v1ne on Sunday November 08, 2026 @07:36AM (#50412729)
Redrawing the whole thing consumes resources. That's power and resources not available to other tasks. There is value in being clever with what you draw.
Re:ZapFast: A fast, native WhatsApp client in Rust and egui by viraptor on Sunday November 08, 2026 @01:50AM (#50411004)
> Basically every device has a GPU.

Many VMs and remote desktops don't. (Or can't really make use of)

Re:ZapFast: A fast, native WhatsApp client in Rust and egui by saghm on Sunday November 08, 2026 @09:47AM (#50413802)
This is an app that connects to your phone and sends messages via the app. I don't think it's that crazy to decide that running on a VM or remote desktop is out of scope.
Re:ZapFast: A fast, native WhatsApp client in Rust and egui by rixed on Sunday November 08, 2026 @02:07AM (#50411074)
[delayed]
Re:ZapFast: A fast, native WhatsApp client in Rust and egui by d3Xt3r on Sunday November 08, 2026 @01:58AM (#50411042)
> Why there is no reactive UI that tracks all dependencies and redraws only what needs to be redrawn?

There's plenty of them. Slint, Floem, iced, Vizia, fltk etc. Slint and fltk in particular also exhibit excellent performance and very little resource usage even without a GPU.

Re:ZapFast: A fast, native WhatsApp client in Rust and egui by dejw on Sunday November 08, 2026 @03:20AM (#50411370)
nothing stops you to render gui at 5 fps. most people won't notice
Re:ZapFast: A fast, native WhatsApp client in Rust and egui by hridyaagrawal on Sunday November 08, 2026 @04:49AM (#50411794)
eframe is reactive by default, so it only repaints on input/animation, mouse moves count as input technically though so you get a pass on hover