Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Why I'm building a new async runtime (stjepang.github.io)
56 points by kasbah on April 4, 2020 | hide | past | favorite | 6 comments


On the note of runtimes that are “outside the boxes” of tokio and async-std, I found a really cool generator lib [0] for Rust that uses async/await (and has macro API to hide this if you want) but implements an extremely simple runtime that just implements the semantics of generators. I thought it was absolutely genius and underrated.

[0] https://lib.rs/crates/genawaiter


Well that was a tease. I suppose the title didn't actual promise me I could read some code, though.


I wonder how it would be if Rust, like Scala came with a very basic executor? For me external crates no matter how popular, seem a no-go because of them constantly changing.


Not familiar enough with rust to say, but this is an interesting comment given I've taken Scala for granted, in a sense


If my memory serves right, there is one in std but it's too simple for most use cases.


No. As of now, std does not contain any executors. Only the minimal machinery that the compiler needs to know about in order to translate async code into structs implementing the Future trait.

I think we will see an executor in std at some point, but seeing how executor design is still an ongoing area of research, it's really good that they didn't include an executor in std prematurely.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: