Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

GP's complaint wasn't about the coloring, but about the fact that the basic async API is not enough for most tasks, so you don't only have colored functions, you're now also bound to an async runtime. The world would be much better if most async rust code was agnostic of the async runtime, despite still having the colored functions issue.


Sure, the situation is just vastly better - even now - than standardizing the wrong solution. Each widely used async runtime in Rust has different solutions for a number of problems, and the choice isn't obvious.

For example, `tokio::spawn()` returns a task handle that lets the task keep running after the handle is dropped. `smol::spawn()` cancels the task when the task handle is dropped.

General async cancellation requires infrastructure mechanisms, and there are multiple reasonable designs.

Letting things settle in the ecosystem is a great way to find the best design to eventually incorporate in the standard library, but it takes time.




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

Search: