News for hackers. Stuff that matters.
Re:Advice for the next 100 Rust GUIs by logicalshift on Sunday November 22, 2026 @02:23PM (#50602974)
I've been working on an animation tool as a side project for really far too long and maybe I've got some interesting 'left-field' approaches to the problems outlined here. Not sure if it's interesting to anyone other than me, though, I've never really got that much engagement. Still, the article says 'be bold'.

What I hit early on with this project is that Rust's ecosystem is very dynamic and whatever I picked wouldn't be current later on and I'd need to replace it. So that's the problem I worked on solving, and I think it's produced something quite interesting.

Core idea is to communicate using streams and not function calls, because you can replace the receiver or map streams to new streams when an API changes. `flo_scene` is the crate I came up with to implement this. It's sort of an actors framework but as it's more to achieve specific goals than implement the theoretical idea of what an actors framework should be it's got its own names for things.

flo_scene divides up large software into 'sub-programs' that talk by sending messages. The dependencies are all defined externally which makes a huge difference to how complexity evolves as software grows: a sub-program that wants to draw something just sends drawing requests without needing to know exactly what or how those requests are realised later on. Similar for displaying a UI: it's just messages that something else handles so replacing the backend is surprisingly easy.

Eg: the old version of FlowBetween can switch between a web app and a Mac OS native app just by changing where it sends the UI messages to: it's a really effective approach at making it so dependencies are always shallow and easy to replace no matter how much stuff is built around them. It can run as both at once too (even weird stuff like mirroring your desktop session as a fully HTML web app), which I think is an entirely unique capability.

Then there's flo_draw which is the rendering library I came up with. This has the same non-monolithic approach to rendering graphics, which lets you do some neat things. One is the very straightforward initialisation it has if you just need a window to draw in (I kind of wanted to get to the point where you could draw stuff the same way you can println stuff but some UI frameworks see the main thread as 'special' so that's not possible) The other is how it lets you compose multiple sources into a single drawing: it has namespaces so that resources can be loaded without conflicting with each other. It has layers so it's possible to combine the output of many sources into a single output. As everything is a stream you can use it as an immediate mode or a retained mode renderer: because it has layers you can do both at once. Last thing it has at a high level are sprites, which are a way to repeatedly render a set of instructions - a modernised version of the old concept - and thus are a generalised composition mechanism.

There are no comments on this comment yet.