3 ms·
> When async is visible in the type system it means you need to write things like iterating containers twice It should be noted that this is only if the type-s
by valenterry 5y ago
> When async is visible in the type system it means you need to write things like iterating containers twice
It should be noted that this is only if the type-system in your language is unable to properly abstract over containers and their capabilities.
If it is powerful enough however, then you can write the code once, under the (important!) assumption of short-circuiting in the case of errors.
- _flux 5y agoSure, it's possible to parametrize your algorithms. However, do you need to explicitly parametrize them or does the language do it for you? I'm not aware of any language that would remove the need to consider them and just automatically "work" with async types whereas "normal" threading—with errors handled via exceptions—more or less work out of the box the way you expect.
- valenterry 5y ago> However, do you need to explicitly parametrize them or does the language do it for you? I'm not aware of any language that would remove the need to consider them and just automatically "work" with async types whereas "normal" threading That's correct. What I said is: you can write your algorithm once and apply it to both sync and async datastructures (given certain constraints). But that doesn't mean that async and sync feels exactly the same. It's simply impossible for this to be true in any meaningful way and has been tried over and over.