3 ms·
Note sure if I fully grasped your quesiton but here it goes. Light threads and stackfull coroutines require stack allocation. That is their cost and it is unbe
by dpc_pw 8y ago
Note sure if I fully grasped your quesiton but here it goes.
Light threads and stackfull coroutines require stack allocation. That is their cost and it is unbearable for system-level language priding itself in zero-cost abstractions. Eg. AFAIK, it's the main reason that is making Go calling C code slow.
Also, (again AFAIK) Rust stackless coroutines and futures compile down to state machines, so I don't understand the "lexical closure overhead".
There's nothing forcing futures to be "running on a single-core cpu" in Rust, since Rust can reason about thread-safety.
Personally, after couple of months of using JS at dayjob, I very dislike JS (as I thought I would), but I love coroutines/yield. I think they will be glorious in Rust: they will allow writting reasonably nice code with an amazing performance.
- wruza 8y agoTo clarify: not why extreme requirements discourage heavier methods, but why people don’t use them for daily jobs that don’t require anything than fastest delivery time.