Iced – A cross-platform GUI library for Rust, inspired by Elm
So I read the 7 month old thread, and I found this comment particularly interesting: <a href="https://news.ycombinator.com/item?id=28332803" rel="nofollow">https://news.ycombinator.com/item?id=28332803</a><p>Basically, it answers the question, "why do Rust GUI frameworks use enums rather than closures for messages in the Elm update pattern?" It is very insightful, but doesn't tell the whole story. In particular, as a major counterexample, Druid <i>does</i> use closures for stuff like buttons, and they update state exactly as expected. That said, the Druid approach does have major drawbacks, chief among them that the app state needs a `Data` bound, which (oversimplifying slightly) means that it only works well with immutable data structures.<p>As it turns out, I've been thinking about how to solve this problem - closures that have convenient access to mutable app state <i>without</i> strange bounds on that state, or strange control flow when doing things like adding and deleting widgets, and think I've finally cracked it. I will be doing a writeup when I have time, but for the eager and curious, there is a code sketch at <a href="https://github.com/linebender/druid/blob/lasagna/lasagna/src/rusty.rs" rel="nofollow">https://github.com/linebender/druid/blob/lasagna/lasagna/src...</a> .