5 ms·
For some applications especially those that benefit from cpu-bound parallelism, it is possible to write much faster code with Go than Node.js, e.g., consider th
by williamstein 1y ago
For some applications especially those that benefit from cpu-bound parallelism, it is possible to write much faster code with Go than Node.js, e.g., consider the recent port of the Typescript compiler from Javascript to Go:
- https://news.ycombinator.com/item?id=43332830 https://news.ycombinator.com/item?id=43332830
- gr4vityWall 1y agoI think 9rx agrees with you. Node.js shines as a web server. It can be made fast at CPU-bound tasks as well, but you wouldn't be writing idiomatic JS/TS. The recent tsc port from TS to Go is a good example of that. The TypeScript code in the compiler relied a lot on polymorphism, which made it really hard for the JIT to do a good job. The Go port enabled them to 'rewrite' it keeping the logic more-or-less 1:1 and land a good performance increase. IMO it was a good decision, specially the language choice, and much saner than what a JIT-friendly TS compiler would be.