30 karma · joined June 2, 2016
Doing something extra to get a behavior different than default is the definition of opt-out my friend.
We have Send and non-Send primitives in Rust for a reason. You could use Arc/Mutex/AtomicUsize/... everywhere on a single thread, but you should use Rc/RefCell/Cell<usize>/... instead whenever possible since those are just cheaper. The problem is that in the ecosystem we are building the prevailing assumption is that anything async must also be Send, which means we end up using Send primitives even in non-Send contexts, which is always a waste.
> If you want every users to only use single threaded runtime, it's a major loss for the Rust ecosystem.
Running single threaded executors does not prohibit you from using threads, it just depends on how you want to do that. You can:
1. Have a single async executor running a threadpool that requires _everything_ to be Send. 2. Have a single threadpool, each thread running its own async executor, in which case only stuff that crosses thread boundaries needs to be Send.
The argument is that there are many scenarios where 2 is the optimal solution, both for performance and developer experience, but the ecosystem does not support it well.
I agree that it won't reach the popularity levels of JS due to the learning curve, but on technical side of things future is _now_.
So, today, after getting a PR for Lunarity that migrates its lexer to Logos coming up green, I'm happy enough with the crate to start talking about it. There are still kinks to iron out, docs to write, and it might need a blog post or some such, but right now I'm happy.
TL;DR: Here is a crate I wrote that allows you to quickly make a Lexer that reads source code at ~1GB/s on a 2016 i7 laptop.
However, there are measurable psychological differences when it comes to preference of the role you want to take, how much risk you are willing to take, and what your priorities regarding status and family are, and we do have evidence that some of it is, at least partially, biological.
By the virtue of those bureaucrats being democratically elected officials responsible to implement the will of said Frenchmen.
Not to say that the situation is perfect, but while there are many things wrong with Europe, but the democracy does work better than it does in the States.