3 ms·
What prevents Rust(as a language) from being used to write UI? Qt is implemented in C++, which rust seems to aim to replace. Rust seems like an excellent conte
by carlhjerpe 6y ago
What prevents Rust(as a language) from being used to write UI? Qt is implemented in C++, which rust seems to aim to replace.
Rust seems like an excellent contender for the future.
- throwaway189262 6y agoMulti threading sanely requires Arc, and reference counting is a crappy form of GC. If you have enough threads passing stuff around and can deal with the ~50% performance loss between Java and Rust, it's much easier to use a language with GC. There's talk of adding a quality GC to rust and dedicated GC types. If/when that happens, Rust will be a contender for a bunch of higher level systems
- steveklabnik 6y agoMany UI toolkits use shared ownership and callbacks, and that's annoying in Rust. Some bindings make it work. There's a bunch of folks working on interesting architectures. But the classic styles just clash with Rust's default way of doing things.
- pjmlp 6y agoThe borrow checker. UIs tend to have designs that require graph based structures and self referencial references, so in the end you get either lots of Rc<RefCell<>> and clone() calls, or have to bind the whole stack to fit into Rust's memory model. Have a look at, https://raphlinus.github.io/rust/druid/2019/10/31/rust-2020.html https://raphlinus.github.io/rust/druid/2019/10/31/rust-2020.... https://raphlinus.github.io/rust/druid/2020/09/28/rust-2021.html https://raphlinus.github.io/rust/druid/2020/09/28/rust-2021....