Re:I’m porting the TypeScript type checker tsc to Go
by nevir on Tuesday January 25, 2022 @03:00PM
(#30077201)
Super skeptical that porting this to a new language is going to have the kind of performance gains they expect ... assuming they want to replicate all of tsc's functionality
[ Parent
| on HN ]
Re:I’m porting the TypeScript type checker tsc to Go
by eyelidlessness on Tuesday January 25, 2022 @03:04PM
(#30077264)
It’s already proven (esbuild, SWC, Bun) to drastically improve performance of TypeScript’s other responsibility: compilation (tsc doesn’t offer an option for this, but ts-node does, for comparison). And while the type checker is certainly more complex, I have a hard time imagining it won’t show similar improvements in a native language.
Re:I’m porting the TypeScript type checker tsc to Go
by resoluteteeth on Tuesday January 25, 2022 @03:35PM
(#30077672)
Compiling typescript is basically just stripping the type definitions/annotations and other typescript-specific parts of the syntax out. That's a huge difference from actually type checking it.
Re:I’m porting the TypeScript type checker tsc to Go
by eyelidlessness on Tuesday January 25, 2022 @06:04PM
(#30079377)
And yet, it’s drastically slower in JavaScript than in Go, Rust and Zig. I realize different algorithms will optimize differently between JS and native code, but I sincerely doubt tsc is anywhere near optimal speed.
Re:I’m porting the TypeScript type checker tsc to Go
by lucian1900 on Wednesday January 26, 2022 @06:43AM
(#30084354)
That's mostly because tsc's parser is used by the JS implementations.
Writing a parser for the purpose would achieve performance closer to the other implementations.