It’s just a massive task that is kind of pointless on top of being massive. We already have a typescript compiler. It works. Rewriting stuff in rust is generally already kind of controversial unless it’s C code that might have significant vulnerabilities, like openssl, anything dealing with serving the internet to a bunch of people. It’s a massive task to rewrite a big project in a new language, and Rust can be tricky sometimes for its own weird reasons. You might have to solve some problems in new ways.
Also, the typescript compiler, you have to understand why it exists and what it does. We have JavaScript that is basically all the client side code for websites. People don’t like that it doesn’t have types or enforce that variables are a specific thing. If I write a function that takes a number but pass it the word “foobar”, JavaScript won’t care.
Typescript was an attempt to basically clean it up with types and it kind of worked. What it does is, you declare the type of variable that your function takes, you say it’s a number. If you then call that function with “foobar”, it won’t even compile your code. It’ll error out and say look dumbass, that’s the wrong type. Fix it, then recompile.
You declare what data types are used where, and the compiler enforces that.
Then what does it do? It emits JavaScript. It literally just needs to check that you are doing things the way you say you’re doing, then the end user still runs basic JavaScript in their browser. Typescript compiles to JavaScript.
Rewriting the compiler itself will just… Generate the same JavaScript and be a bit faster, in a best case scenario.
It’s just a massive task that is kind of pointless on top of being massive. We already have a typescript compiler. It works. Rewriting stuff in rust is generally already kind of controversial unless it’s C code that might have significant vulnerabilities, like openssl, anything dealing with serving the internet to a bunch of people. It’s a massive task to rewrite a big project in a new language, and Rust can be tricky sometimes for its own weird reasons. You might have to solve some problems in new ways.
Also, the typescript compiler, you have to understand why it exists and what it does. We have JavaScript that is basically all the client side code for websites. People don’t like that it doesn’t have types or enforce that variables are a specific thing. If I write a function that takes a number but pass it the word “foobar”, JavaScript won’t care.
Typescript was an attempt to basically clean it up with types and it kind of worked. What it does is, you declare the type of variable that your function takes, you say it’s a number. If you then call that function with “foobar”, it won’t even compile your code. It’ll error out and say look dumbass, that’s the wrong type. Fix it, then recompile.
You declare what data types are used where, and the compiler enforces that.
Then what does it do? It emits JavaScript. It literally just needs to check that you are doing things the way you say you’re doing, then the end user still runs basic JavaScript in their browser. Typescript compiles to JavaScript.
Rewriting the compiler itself will just… Generate the same JavaScript and be a bit faster, in a best case scenario.