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

>about how futures-based concurrency spreads into your code through huge amounts of necessary boilerplate (`.and_then(...).and_then(...).and_then(...)`)

How is that more boilerplate than any other way to have concurrency?



Async/await is commonly suggested as a lighter-weight syntax.


Well, isn't async/await complementary to futures?


Oh, it is, it just makes them a lot easier to use. The compiler does method restructuring magic behind the scenes to build the necessary state machines. Everything gets a lot easier to understand.


Do notation makes this stuff a whole lot more readable (See Haskell). Or Async-await (See C#)


About do notation, can't Rust get something similar with macros? (I still didn't get to making macros in it.)


There is a crate that does it in a duck-typed manner. It's not clear that the stronger typed version can work. We'll see.


+1. Also, Go's goroutines and channels.




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

Search: