|
|
|
|
|
by samatman
1528 days ago
|
|
You can't know this function will actually finish without looking inside of bar() in any Turing Complete language, because this is the Halting Problem. Not in a trivial way either. A good async language will never let std.log.info print until/unless bar resumes. The difference between a "blue foo" and a "red foo" is also subtler than we pretend it is. Both will finish eventually, unless they don't, and both may be paused for as long as the OS wants in any preƫmptive operating system. |
|
They could instead require me to explicitly write `await bar();` within foo(), and I could find comfort in the "no hidden control flow" tenet of the language once more. I recognise now that this would break the colour-blindness of their async implementation and that this is a pretty significant trade-off, but my perspective remains that this breaks one of the rules they've laid out on their homepage.