3 ms·
Is there something like this but without concurrency? I don't need concurrency or multithreading, and most of my pain with Rust has come from the fact that it p
by andai 2y ago
Is there something like this but without concurrency? I don't need concurrency or multithreading, and most of my pain with Rust has come from the fact that it prevents me from doing things that I know are correct because it thinks my code will run in a multithreaded environment (it will not).
It seems like Yao's whole project is solving the concurrency problem.
I'm like, why not drop it entirely (if performance isn't one of the language's top priorities anyway)? What does keeping it gain that's so important? (Context: I don't understand concurrency and multithreading.)
- gavinhoward 2y agoGood question. Yao's concurrency will be explicit. You will not get concurrency unless you open a threadset and spawn threads. Yao scripts run in a single thread by default. I focused on solving the concurrency problem because if it is solved, single thread code is solved as well.
- skitter 2y ago> it prevents me from doing things that I know are correct because it thinks my code will run in a multithreaded environment Could you elaborate on that? In your case you don't need to worry about Send/Sync, you can use Cell/RefCell, etc. The borrow checker isn't about threading, it's useful in a purely single-threaded context too.
- School-Cotton 2y agoNot OP but don’t a lot of async libraries require things to be Send because they assume they’ll run on a multithreaded executor?
- ruthmarx 2y ago> I don't need concurrency or multithreading, > ... > Context: I don't understand concurrency and multithreading. I get not needing it, but if you don't understand concurrency or multithreading how are you so certain you don't need concurrency or multithreading?
- klabb3 2y ago> I don't need concurrency or multithreading Famous last words. Ever needed a timeout? Cancelation? Respond to Ctrl+C (SIGINT)? Your UI has an event handler? Client server architectures? All of those things need concurrency, somewhere. That said, you could argue that I’m being nitpicky. A combination of the OS and language runtime (eg JavaScript) can keep you mostly isolated from the complexity explosion of parallelism and concurrency. But it’s still there.