6 ms·
Even regular sync functions in JavaScript can do lots of computations that take a long time. And others perform effects like starting a timer or manipulating th
by brokencode 1y ago
Even regular sync functions in JavaScript can do lots of computations that take a long time. And others perform effects like starting a timer or manipulating the DOM. Should these be indicated with keywords too?
I agree that await is a nice hint in the code that something more substantial is happening, but ultimately it’s limited and quite opaque.
Great IDE support for algebraic effects would probably include inline hints to show effects.
- skybrian 1y agoIn a language with an effect system, presumably modifying the DOM would be an effect. Maybe some effects should have call sites annotated, like ‘async’, and others should not, like DOM manipulation? It seems like an API design issue. What do you want to call out for extra attention?