Xilem: An Architecture for UI in Rust
From the first paragraph:<p>> ... Architectures that work well in other languages generally don’t adapt well to Rust, mostly because they rely on shared mutable state and that is not idiomatic Rust, to put it mildly. ...<p>The author doesn't mention Redux (the architecture), which is surprising. There are three principles[1]:<p>1. The global state of your application is stored in an object tree within a single store.<p>2. The only way to change the state is to emit an action, an object describing what happened.<p>3. Changes are made with pure functions.<p>In other words, the components of an application never mutate the state tree directly. Rather, they emit actions which re-generates the state tree without mutation.<p>This style of state management is compatible with Rust's ownership model.[2] The emphasis on pure functions (that <i>clone</i> state rather than mutate) means that it's not necessary for your application to alias mutable references, which I'm guessing underlies the "generally don't adapt well to Rust" part of the claim.<p>[1] <a href="https://redux.js.org/understanding/thinking-in-redux/three-principles" rel="nofollow">https://redux.js.org/understanding/thinking-in-redux/three-p...</a><p>[2] <a href="https://github.com/jaredonline/redux-rs" rel="nofollow">https://github.com/jaredonline/redux-rs</a>