4 ms·
I wonder if they will write a TypeScript type checker in rust? TypeScript currently only has one serious implementation that actually checks types (esbuild, for
by jamescostian 5y ago
I wonder if they will write a TypeScript type checker in rust? TypeScript currently only has one serious implementation that actually checks types (esbuild, for example, does no type checking). Getting another one that's written in rust would be tremendously helpful for type checking times!
But, on the other hand, if they don't write a type checker in rust, we may still need `tsc`. Since Rome won't be written in JS/TS, I worry that calling The official TypeScript compiler from rust may be prohibitively expensive, necessitating users to run a separate `tsc` process. That goes against Rome's goal of having a single AST generated once by a single tool
- flaque 5y agoThere already is one, and it’s used by Deno! https://swc.rs/ https://swc.rs/
- thdxr 5y agoThis actually only builds and does not type-check similar to esbuild. The author is working on a proprietary type-checker in Rust though
- jamescostian 5y agoThat doesn't support type checking, see https://github.com/swc-project/swc/issues/571 https://github.com/swc-project/swc/issues/571 You'd still need to run `tsc` to check types even if you used swc
- flaque 5y agooh, good point, apologies
- caspervonb 5y agoWe use swc a lot but not for type-checking, that is still done by tsc loaded into a snapshot (precompiled v8 state). There is a type-checker in the works tho https://stc.dudy.dev/docs/status/ https://stc.dudy.dev/docs/status/