3 ms·
If you could spare some time, would you please demonstrate an example? Any language of those mentioned would be OK.
by bheadmaster 5y ago
If you could spare some time, would you please demonstrate an example? Any language of those mentioned would be OK.
- fasterthanlime 5y agoHere's a Rust example, with tokio: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=825256f548eb9bb5df528704867f80fd https://play.rust-lang.org/?version=stable&mode=debug&editio... - I don't have time to come up with Java/C++ examples, but I'm sure others will. (If your point was about it being _built into the language_, then it definitely stands, see the other discussion in the parent comment thread)
- paskozdilar 5y agoYeah, I guess I overestimated the complexity of such mechanisms. I mean, still, you need some kind of runtime for the asynchronicity, but the Rust version seems fairly OK (apart from the function coloring, but that's another story). I guess I just like it being built into the language. Plus no function coloring (everything is asynchronous, but appears synchronous) really makes it easy to build complex systems.
- autarch 5y agoHere's a rust example - https://github.com/autarch/channel-select https://github.com/autarch/channel-select