News for hackers. Stuff that matters.
Re:Announcing Rome Tools, Inc. by orta on Tuesday May 04, 2021 @01:17PM (#27039948)
FWIW, sucrase (written in TypeScript) has done a great job of being in the same ordinal of perf as esbuild: https://github.com/alangpierce/sucrase#sucrase
Re:Announcing Rome Tools, Inc. by lhorie on Tuesday May 04, 2021 @03:11PM (#27041618)
Sucrase "cheats" though[0]:

> Sucrase bypasses most of these steps, and works like this: Tokenize the input source code into a token stream using a trimmed-down fork of the Babel parser. This fork does not produce a full AST, but still produces meaningful token metadata specifically designed for the later transforms.

While this is fine for simple transformations like transpiling JSX, it's not very suitable for full-on AST analysis like some eslint plugins do. Most notoriously, Sucrase is specifically designed to be garbage-in-garbage-out, whereas Babel will throw proper errors on things like early errors.

Tools written in lower level languages like esbuild can take advantage of facilities that aren't well supported in Node, such as cheap concurrent coroutines and greater control over memory layout (Babel ASTs are notoriously megamorphic and can silently fall off perf cliffs depending on how you manipulate them). These caveats are not reflected in Sucrase's benchmark.

[0] https://github.com/alangpierce/sucrase#motivation

Re:Announcing Rome Tools, Inc. by Touche on Tuesday May 04, 2021 @02:44PM (#27041242)
That's single threaded perf, so takes away a huge advantage of Go. Also doesn't include startup time (node is slow to start)
Re:Announcing Rome Tools, Inc. by serverholic on Tuesday May 04, 2021 @02:46PM (#27041265)
And memory usage.