4 ms·
Zig's use of "async" as a call-site modifier is exactly how I've long wished async/await had been done in languages like JavaScript and Rust. It completely fixe
by atombender 6y ago
Zig's use of "async" as a call-site modifier is exactly how I've long wished async/await had been done in languages like JavaScript and Rust. It completely fixes the "color" problem.
I brought it up on HN once, and apparently this was discussed as an option for Rust, but for whatever reason, people didn't like it. To be fair, Rust has certain design requirements that might not be compatible with such a system.
- j-pb 6y agoThe reason is that it creates completely unexpected bugs, like deadlocks. Static function coloring based in asyncronicity is a feature not a bug. Making it "dynamic" is like saying: "Yeah we've decided that if you just treat an Option as a value, we will let you do it, and we'll also treat every Option boxing inside your map as a noop."