by ausjke · 7y ago · 0 comments
In 2019 I still have 0 interest in javascript/TS for backend, the thousands of modules under node_modules alone is enough for me, and not all real world product need async/promise/callback/SPA, javascript is over-heated too much, not fun at all.
That Javascript is async-everything is one of its best and often overlooked features in these comparisons.
I think this snippet encapsulates a lot of why Javascript is actually very pleasant on the server:
const results = await Promise.map(urls, (url) => process(url), { concurrency: 8 })
.then((results) => postprocess(results))If you want to look at bolt-on async working, check out C# or Rust. They've basically taken JavaScript's new async/await and added threading (at least Rust has, not sure about C#). You can write an async app and have it run in a thread pool without much fuss.
I don't know what the story is for Java, but seeing as C# is effectively the same thing, it's not hard to imagine adding async being easier than adding threads or performance to JavaScript.