3 ms·
> This is actually the root of the function color problem: async is exactly backwards! Instead of marking asynchronous functions, languages should have had us m
by cryptonector 2y ago
> This is actually the root of the function color problem: async is exactly backwards! Instead of marking asynchronous functions, languages should have had us mark synchronous functions, and then async should have been the default!
What happens when you need to add a new trait that all existing functions must be changed to have? That's why async is generally an attribute.
The answer is that we'd have to say that all functions have some default trait set that can be extended automatically as the language evolves, except those anti-traits they have. Then we could say that a function is async meaning "not sync", or even we could write !sync instead of async.
I rather like the idea that you have to write `!sync` instead of `async`.
- gavinhoward 2y agoThe post answers that. Every unmarked function can do anything. If you add a new thing that functions can do, you assume unmarked functions can do it (even if they don't), and you add a trait for the negative.
- cryptonector 2y agoThanks, I got interrupted in my reading.