2 ms·
Yes, you could just use Arc everywhere. But then you've spent a large portion of your coding time fighting the compiler and wasting lines for something that wil
by nurettin 1y ago
Yes, you could just use Arc everywhere. But then you've spent a large portion of your coding time fighting the compiler and wasting lines for something that will essentially always be single threaded. (a UI event loop)
The C++ solution would be to start the threads and use an MPSC queue (which, ironically, Rust also has) in order to update the UI.
Rust will eventually stumble upon ergonomics and allow portions of code to be specified as single threaded or embarrassingly parallel, but unfortunately the community evolved horse blinders early on and isn't letting them go any time soon.