Essentially the same html/css rendering of Firefox or Chromium, still able to access the www, but with javascript fully removed for another language that can be interpreted - like python or lua. Is this feasible?

  • CameronDev@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    2 days ago

    I dunno, I don’t see the benefit to native TS in the browser. For compatibility, all sites will continue to serve JS, so what does TS gain anyone? And there is no performance benefit, maybe a performance hit given none of the type validation can happen until all of the scripts have downloaded, so execution can’t begin until that has happened?

    I could be way off on this though, I’m not a webdev :/

          • CameronDev@programming.dev
            link
            fedilink
            arrow-up
            1
            ·
            1 day ago

            I don’t think I understand. Native TS does the type checking at compile time right? Not run time? Or would the compile happen in the browser?

              • CameronDev@programming.dev
                link
                fedilink
                arrow-up
                1
                ·
                1 day ago

                At least in the node.js native TS implementation, they strip the types and don’t do checks, so you don’t get runtime type checks:

                Node.js does not type check your code when it runs TypeScript files. Use the TypeScript compiler separately if you want to catch type-related errors:

                https://nodejs.org/learn/typescript/run-natively

                I think, but I’m no expert, but in order to have type checking you need to have some kind of compilation check? You cant just start interpreting and hope to work things out on the fly?