4 ms·
I love Typescript and the type system is getting pretty powerful. I would like to use it more in commandline utilities, but then I find the JS event loop makes
by tlarkworthy 8y ago
I love Typescript and the type system is getting pretty powerful. I would like to use it more in commandline utilities, but then I find the JS event loop makes sequential commands annoying, or REPLs need trampolining etc.
There is nothing in typescript that actually ties the type system to the event loop. I would love the Typescript language applied to a runtime that was ok with blocking IO.
- rictic 8y agoFor CLIs I end up doing something like: async function main() { } main().catch(e => { console.error(e); process.exit(1); }); Async/await is what I want, more than blocking, because frequently to make a CLI fast I need to do things in parallel. I'm often working against a network filesystem though, so doing as much FS stuff in parallel has a big payoff.