7 comments

  • __benny__1 minute ago
    Nice article, thank you for sharing it.<p>I do want to nitpick this part however:<p>&gt; That’s been playing out architecturally in the choice between immediate mode and retained mode. Immediate mode is very appealing because it’s less total code and seems quite a bit simpler. And for some applications (most especially development support for games) it works well. However, I am concerned it won’t scale especially well. In short, it’s good at the first 90%, but it makes the second 90% harder. To be considered really production-ready, it has to establish stable widget identities to build and update the accessibility tree, and it has to reliably cache expensive intermediate artifacts such as text layouts (simple immediate mode often gets around this by cutting corners in text layout, which may be fine for gamedev). And of course, it pulls strongly towards a model of re-rendering everything every frame rather than exploiting layers in the compositor.<p>It&#x27;s a common criticism but I don&#x27;t think it&#x27;s based on anything other than preconceived notions about rendering being slow and doing a ton of caching makes everything faster. but neither seem to be backed up by any sort of empirical evidence. Anecdotally every imgui I&#x27;ve used has been lightening fast, and retained mode UI&#x27;s like the browser, windows software, new Macos apps written in SwiftUI, etc, have performance problems.<p>Egui has solved the accessibility problem and does a lot of caching: galleys, glyphs, and layouts are cached, packed texture atlases minimize GPU uploads, and it uses inputs &amp; animation state to draw on demand.<p>I also don&#x27;t see how retained mode UI would scale better. Retained mode UI&#x27;s are typically slow - they have a complex multi-pass general layout system and a ton of bookkeeping, which is why you typically need to keep updates to a minimum and ever-more-complex change tracking systems are being built to reduce updates to a minimum. This doesn&#x27;t scream scalability to me - whereas in an imgui there is a baseline overhead but adding more widgets or more frequent updates have a negligible performance impact. the worst case for retained mode is a UI which has many widgets frequently updating multiple times a second, which means you approach the update and drawing of imgui but with the additional overhead of the change tracking, bookkeeping, etc of the retained system.<p>Also there is nothing fundamental about imgui layout systems being limited, and in my experience it&#x27;s not that difficult to build custom widgets to implement pretty much anything. Retained mode layout systems are usually declarative, where you describe a layout and hope that the system is flexible enough to support what you want, whereas with an imgui you can just directly draw and shade geometry to get whatever you want.<p>Otherwise, great article and I look forward to the future of Rust UI.
  • dv_dt28 minutes ago
    I found Qts signal&#x2F;slot system very nice to work with to help with bridging the application logic to UI events and flows. Maybe rust&#x27;s generic async is all you need, but I suspect that a GUI should probably have some opinion of how it interacts with async.
  • jacoplane53 minutes ago
    I just use Flutter for the UI and then use <a href="https:&#x2F;&#x2F;cjycode.com&#x2F;flutter_rust_bridge&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cjycode.com&#x2F;flutter_rust_bridge&#x2F;</a>
  • JohnAaronNelson54 minutes ago
    Arguing about coding languages seems quite passé. If there is an imperative reason to use something for performance reasons, I’ll bite. Otherwise, it seems silly. The prompts will not differ much and the rewrites are trivial. What matters to me is the experience, not the tech.
  • amelius1 hour ago
    Or do as Mitcad does: use C++ to talk to Qt, and do the rest in Rust.
  • vkaku1 hour ago
    I think the Rust GUI scene is fast catching up. After using ArtCraft on my PC, I was amazed at the responsiveness and expressiveness of the GUIs being implemented and I feel they&#x27;ve come a long way. I was used to running slow JS based apps all the time, any of these native ones feel like an upgrade to me.<p>Having said that, I think we&#x27;ve come to an era where concerns like these can be quickly addressed and responsiveness tested, so looking forward to more of this kind of analysis and more usable applications in the near future.
  • redsummer44 minutes ago
    [dead]