• terranoid@lemmy.cafe
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 day ago

      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.

      • The_Decryptor@aussie.zone
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 hour ago

        Rewriting the compiler itself will just… Generate the same JavaScript and be a bit faster, in a best case scenario.

        They actually did just do a re-write of the compiler (in Go), and yep it was for speed.

      • someone@lemmy.today
        link
        fedilink
        arrow-up
        1
        ·
        17 hours ago

        So it’s memory-safe coding for something that will output JavaScript anyway and it’s really hard and tedious for Claude to change over. I get it now!

    • ThotDragon@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 day ago

      In a kinda fatalistic/pessimism thing. AI people seem to lack self awareness which is ironic because they claim to have made a computer program that has it.