News for hackers. Stuff that matters.
Re:Show HN: Coerce – Actor runtime for Rust using async/awai... by Argorak on Sunday December 15, 2019 @12:39PM (#21797521)
The position of the async-std project is that people should use _futures-rs_ as the integration point and avoid integrating into tokio or async-std if possible. (both are IO optimised)

Especially for things like an actor system, I would recommend to not use either, but instead spawn a dedicated number of threads handling the actors. This allows you to be specifically optimised to the problem. bastion is a great example for that.

async-std ships a second library called "async-task", which implements just the task/future allocation component and allows you to quickly implement your own runtime.

Full disclosure: I'm one of async-std's maintainers.

Re:Show HN: Coerce – Actor runtime for Rust using async/awai... by xiphias2 on Sunday December 15, 2019 @12:48PM (#21797600)
I understand this, but it still doesn't answer the main point: are you working together with tokio maintainers to move to futures-rs as soon as possible and even extend the interface of futures-rs more if needed?

In my view the separate interfaces increase the long term damage that new libraries are creating every day, and it should be higher priority to resolve it together before implementing new features in either of the two libraries (async-std and tokio).

Re:Show HN: Coerce – Actor runtime for Rust using async/awai... by Argorak on Sunday December 15, 2019 @01:02PM (#21797712)
We don't maintain futures-rs. But for the reasons you outline above (stability), our interface is also effectively done.

The choice of not using all of futures for their interface is outspoken the strategy of tokio. We have encouraged them to prefer the futures layers, but we don't see the work happening.

So, to answer your question: we are not working with them, the place of collaboration is futures-rs.

Re:Show HN: Coerce – Actor runtime for Rust using async/awai... by ComputerGuru on Sunday December 15, 2019 @01:00PM (#21797697)
I have heard that using the async-std APIs (but not the reactor and executor) causes background futures to be spawned to the async-std specific executor. I’m not sure of the veracity of this claim, can you comment?
Re:Show HN: Coerce – Actor runtime for Rust using async/awai... by Argorak on Sunday December 15, 2019 @01:08PM (#21797761)
Sooo... in standard profile, yes. `async_std::spawn` uses async-stds runtime. Also, our io interfaces (TcpListener, etc.) are effectively bound to our runtime (they need our mio instance in the back).

But this cannot made work generically in the current ecosystem, as there are no common abstractions here. We can't come up with those unless we have buy-in from other players.

For applications, that doesn't really matter: you pick one Listener type and you're done. Applications aren't very generic.

For libraries, that's harder, but there's strategies around that make it feasible to work with this situation (mainly: injecting the exact type to use into your library).

Finally: there's a flag in async-std called "runtime". If you turn it off, you can use async-std without that behaviour, at the cost of having to bring your own runtime.

Re:Show HN: Coerce – Actor runtime for Rust using async/awai... by ComputerGuru on Sunday December 15, 2019 @01:35PM (#21797923)
Thank you. I’m mainly concerned with library development, so I found your answer helpful.
Re:Show HN: Coerce – Actor runtime for Rust using async/awai... by Argorak on Sunday December 15, 2019 @01:43PM (#21797988)
We're working on the rest :). Look out for some announcements in the coming days and weeks.
Re:Show HN: Coerce – Actor runtime for Rust using async/awai... by mamcx on Sunday December 15, 2019 @02:14PM (#21798238)
Let me derail a little: Which one is better to have a coroutine like experience?
Re:Show HN: Coerce – Actor runtime for Rust using async/awai... by Argorak on Sunday December 15, 2019 @04:45PM (#21799206)
None, I would suggest pushing on the stabilisation of generators ;).
Re:Show HN: Coerce – Actor runtime for Rust using async/awai... by mamcx on Sunday December 15, 2019 @07:40PM (#21799998)
Yeah, but it look like is still far away :(