What does HackerNews think of stc?

Speedy TypeScript type checker

Language: Rust

#55 in Rust
#20 in TypeScript
Wonder no more: https://github.com/dudykr/stc

Written in Rust by the (lead?) dev of SWC

---

SWC (speedy web compiler) compiles TS to JS

STC (speedy type checker) checks TS types

Note that there’s at least one TypeScript type checker being developed in Rust by a third party:

https://github.com/dudykr/stc

>If we could push JavaScript performance to be another order of magnitude faster

And it would speed up the TypeScript Compiler.

My bet is:

TypeScript typechecker in Rust:

https://github.com/dudykr/stc

typescript(tsc) is the only one that does type checking.

bun, deno, esbuild, swc etc. can parse the syntax, but they chuck the TS (they probably don't even add it to the AST, but I haven't checked).

Keeping up with syntax is very doable. It doesn't change often, and updating the parser when it does isn't much work.

There are some past/ongoing projects[1][2] to create type checkers faster than tsc, but they aren't going to reach full parity and probably don't plan on keeping up with language features.

[1] https://github.com/dudykr/stc

[2] https://github.com/marcj/TypeRunner

The author of swc is currently working on a Rust-port of the type checker: https://github.com/dudykr/stc

Here is an interview with them: https://www.totaltypescript.com/rewriting-typescript-in-rust

It is popular in newgen tooling but I feel its more a function of the slowness of `tsc` than anything else. I get why `tsc` is slow, and have a lot of respect for the team and the constraints they work under but I can't help but feeling if we were to get a faster type checker (potentially `stc` from the creator of `swc` which also does this? https://github.com/dudykr/stc), this choice would be less popular. However if I'm honest I don't know if TypeScript's type system means that there are some natural constraints on how fast it can be validated.