3 ms·
We do have libraries for asynchronous io, and co routines, they're just not ready yet. I absolutely agree with you that these things are useful, but the code ne
by steveklabnik 11y ago
We do have libraries for asynchronous io, and co routines, they're just not ready yet. I absolutely agree with you that these things are useful, but the code needs to be written by someone. We're just at the stages where these things are getting good enough to try out.
(And the language can't have exactly the same stuff as Go or Erlang without adding a runtime, which is contrary to the goals of the project.)
- acconsta 11y agoThat's great. I look forward to seeing them evolve and hopefully become standardized. >(And the language can't have exactly the same stuff as Go or Erlang without adding a runtime, which is contrary to the goals of the project.) Here is 90% of what Go gives you as a C library. No heavyweight runtime necessary: http://libmill.org/ http://libmill.org/
- burntsushi 11y ago> Here is 90% of what Go gives you as a C library. No heavyweight runtime necessary Rust has channels in its standard library. Admittedly, they do not have the same functionality as Go's concurrency primitives. The two most significant omissions are probably a multi-producer/multi-consumer channel and a more complete (and stable) `select` construct. There is also my `chan` library, which replicates Go functionality with respect to channels: http://burntsushi.net/rustdoc/chan/ http://burntsushi.net/rustdoc/chan/ --- Notably, you still have to use native threads. Your `libmill` example is a coroutine library with a scheduler and everything. That is definitely too much runtime for standard Rust. However, there are people working on coroutines in Rust, on which something like `libmill` could be built: https://crates.io/search?q=coroutine https://crates.io/search?q=coroutine
- acconsta 11y ago>That is definitely too much runtime Is it incompatible with native threads? (no) Does it affect non-coroutine functions? (no) Does it have any effect whatsoever when not using the library? (no) I encourage you to look over the code before dismissing it as "definitely too much runtime."
- burntsushi 11y ago> I encourage you to look over the code before dismissing it as "definitely too much runtime." I encourage you to take a look at ongoing work on coroutines in Rust, which was the part of my comment where I didn't dismiss your point. I think the portion of my comment you quoted was taken out of context.