4 ms·
Cheap-enough coroutines seem to be new in C++ but what about other languages such as Go, Rust, Haskell?
by tuukkah 8y ago
Cheap-enough coroutines seem to be new in C++ but what about other languages such as Go, Rust, Haskell?
- AlexanderDhoore 8y agoGo has channels which are much more like fibers. Full threads of their own with actual stacks (which can be moved in Go). If C++ or Rust ever get coroutines they will be more low-level. Just a control flow construct which compiles coroutines down to state machines. So it's concurrency, not parallelism. High performance for one thread, but less powerful conceptually. Rust used to have segmented stacks, but they removed it because performance was unpredictable.
- tuukkah 8y agoRust seems to have stackless coroutines as an experimental language feature: https://doc.rust-lang.org/nightly/unstable-book/language-features/generators.html https://doc.rust-lang.org/nightly/unstable-book/language-fea...