Explicit Lazy Evaluation
async/await, lazy/eval
Some languages implement async functions so that the function only starts executing once you call await on its return value. I eventually realized we can use that to write explicitly lazily evaluated code. I'd even go so far as to say that this may be an acceptable use of async/await if you actually need lazy evaluation, because
lazy evaluation is a kind of asynchronous execution, and
much like concurrency, it is the caller's business.
This is probably not ideal. Lazy evaluation and concurrency are conceptually different, and imply different possibilities that you need to worry about. So an implementation that conflates them risks human error and confusion. But it gave me the idea for another pair of keywords, maybe lazy/eval, to do explicit lazy evaluation.
















