by amelius · 11y ago · 0 comments
I was hoping one day Javascript could support "deep" coroutines, so we can keep on programming "sequentially" as we did before while still using asynchronous mechanisms.
Perhaps there exist languages that compile to Javascript, that offer deep coroutines (?)
Babel already enables them.
fs = require 'fs'
mojo = fs.readFile 'mojo.txt' 'utf-8' ^!
console.log (mojo)
(note that if readFile returned a promise you wouldn't need to use the ^)