by dwattttt · 7mo ago · 0 comments
The original function colouring essay was much more about JavaScript's implementation than a general statement.
If JavaScript had exposed a way for a synchronous function to call back into the runtime to wait for an async function to complete, it would still be just as coloured, but no one would be complaining about colour (deadlocks yes, but that's another kettle of fish).
EDIT: with the exception of doing IO on a freshly allocated, in-memory buffer that doesn't escape the function call.
(it's what I'm planning for my own lang, having `trace` be "blessed" to not make a function unpure despite I/O)