• RandoCalrandian@kbin.social
    link
    fedilink
    arrow-up
    2
    ·
    10 months ago

    Refusing rust and wasm is a signal you don’t care about code quality or security

    See? You can keep playing that game all the way down to the most onerous language

      • abhibeckert@beehaw.org
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        9 months ago

        WASM allows arbitrary code execution in an environment that doesn’t include the DOM… however it can communicate with the page where the DOM is available, and it’s trivial to setup an abstraction layer that gives you the full suite of DOM manipulation tools in your WASM space. Libraries for WASM development generally provide that for you.

        For example here’s SwiftWASM:

        let document = JSObject.global.document
        
        var divElement = document.createElement("div")
        divElement.innerText = "Hello, world"
        _ = document.body.appendChild(divElement)
        

        It’s pretty much exactly the same as JavaScript, except you nee to use JSObject to access the document class (Swift can do globals, but they are generally avoided) and swift also presents a compiler warning if you execute a function (like appendChild) without doing anything with the result. Assigning it to a dummy “underscore” variable is the operator in Swift to tell the compiler you don’t want the output.

    • MrGG@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      10 months ago

      Actually, if you really care about quality and types on the front end rust+wasm is not a bad idea 🤔

      Now that I’ve typed that and read it back, were people using TypeScript for anything other than front-end web dev?

        • MrGG@lemmy.ca
          link
          fedilink
          arrow-up
          0
          ·
          10 months ago

          That is disturbing. From my perspective, anyway. There are already so many great (and more appropriate) stacks for web backends, why Frankenstein a Frankenstein into it?

          • Knusper@feddit.de
            link
            fedilink
            arrow-up
            1
            ·
            10 months ago

            Well, usually because you’ve got a team of frontend folks needing to do a backend.

            There’s one other advantage, which is that you can have a compile-time shared model between backend and frontend. You also have that advantage with WASM, but not with a traditional backend/frontend technology split…

            • abhibeckert@beehaw.org
              link
              fedilink
              arrow-up
              2
              ·
              edit-2
              9 months ago

              Compile time is my biggest issue with TypeScript. I’ve used JavaScript for decades with compile time measured in, what, a millisecond or two. Having to wait for TypeScript drives me nuts.

      • PenguinCoder@beehaw.org
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        10 months ago

        Because at the end of the day TypeScript is still Javascript and it’s still bad. Just has some verbose formats to try and make weakly typed language (javascript) appear to be strongly typed. It adds more build steps to what shouldn’t be there; build steps make sense for apps, they make much less sense for libraries.

        https://dev.to/bettercodingacademy/typescript-is-a-waste-of-time-change-my-mind-pi8
        https://medium.com/@tsecretdeveloper/typescript-is-wrong-for-you-875a09e10176

        • pjhenry1216@kbin.social
          link
          fedilink
          arrow-up
          0
          ·
          10 months ago

          I’m sorry. Whoever wrote that should give up trying to write articles. It’s poorly written and will never convince anyone to change their mind. It’s shit. “I know how to convince people they’re wrong. Insult them. Setup a ton of strawman arguments. Genius.”

          Whoever wrote that is bad and should feel bad.

            • pjhenry1216@kbin.social
              link
              fedilink
              arrow-up
              1
              ·
              10 months ago

              Second one. Just realized there were two. Being close together and the first being long enough to get trailing “…” it all just looked like one big link when I first saw it. May just be Kbin displaying it that way.