go means it's going to be easier to integrate to esbuild :) I'm happy to see this, as honestly I don't really understand why you would compile TS without type checking.
I’m porting the TypeScript type checker tsc to Go
21–30 of 252 posts
Re: I’m porting the TypeScript type checker tsc to Go
#22go means it's going to be easier to integrate to esbuild :) I'm happy to see this, as honestly I don't really understand why you would compile TS without type checking.
You compile ts without type checking when the options to do so are 10x+ faster than with type checking.
Re: I’m porting the TypeScript type checker tsc to Go
#23tsc relies in shared state and is slow, so they port it to a language that allows shared state. Strange reasoning.
But moreover, my takeaway was that the author is making a distinction between a complete rewrite and a port, where the former seems to be any rewrite that just tries to do the same thing (but may be architecturally very different), while the latter seems to be an approach where you attempt to directly adapt the original source code into a new language on a statement-by-statement basis. The latter would likely require the target language to support the programming paradigms which are used heavily in the original source code.
Re: I’m porting the TypeScript type checker tsc to Go
#24Earlier quoted context omitted.
> I'm happy to see this, as honestly I don't really understand why you would compile TS without type checking. I don't think I'm remotely alone in doing this but I'll share from my perspective. I have two modes while writing TypeScript stuff: 1) prototyping something where I don't want to spend time writing types (or maybe I write some types but I don't care if they are correct or line up yet) but I still want to hav…
Out of curiosity, how often do you have a project in the first mode that gets large enough that the speed of compiling TS to JS is significant?
Re: I’m porting the TypeScript type checker tsc to Go
#25Re: I’m porting the TypeScript type checker tsc to Go
#26tsc relies in shared state and is slow, so they port it to a language that allows shared state. Strange reasoning.
Re: I’m porting the TypeScript type checker tsc to Go
#27> tsc depends on shared mutability and has a cyclical mutable reference. Rust is designed to prevent this behavior. Having two references to the same data (shared mutability) is undefined behavior in Rust. This problem has numerous solutions in Rust - (A)Rc, RefCell etc. I don't understand how this caused the author of the article to stop considering Rust.
tsc was designed expecting GC and it makes perfect sense to port it to another fast GC language.
Re: I’m porting the TypeScript type checker tsc to Go
#28Re: I’m porting the TypeScript type checker tsc to Go
#29The thing with all those projects is playing catch-up with upstream, and the possible variations from what is actually the official semantics depending on the TypeScript version.