• Oliver Lowe@apubtest2.srcbeat.com
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    As someone who never did much web development, I was… surprised… at the amount of tooling that existed to paper over this issue. The headaches which stood out for me were JavaScript bundling (then you need to choose which tool to use - WebPack but then that’s slow so then you switch to esbuild) and minified code (but that’s hard to debug so now you need source maps to re-reverse the situation).

    Of course the same kind of work needs to be done when developing programs in other languages. But something about developing in JS felt so noisy. Imagine if to compile Java or Rust you needed to first choose and configure your own compiler, each presenting their own websites with fancy logos adorning persuasive marketing copy.

    • Bourff@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      3 months ago

      Isn’t DOM manipulation notoriously tedious with WASM? That seems quite a showstopper for most client-side js I’d say.

    • SuperSpruce@lemmy.zip
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      I still have no idea what WASM really is. I’ve tried looking at articles but it still confuses me. I know how to use HTML, CSS, JS, and actual ARM assembly language at a basic level, but I don’t see how any of this could be used with WASM.

      • onlinepersona@programming.dev
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 months ago

        WASM is just like assembly. It has instructions similar to MOV, JMP, STA, etc. It can be distributed as the textual instructions or as the compiled binary format.

        When it started it was interpreted by JS or could be compiled to JS directly. It proved to be faster than hand-written JS. However, it still had to go through a JS interpreter. Now, there’s a WASM interpreter / virtual machine built into browsers. It’s very much the new java bytecode but without running an unsandboxed, external (outside of the browser) java virtual machine.
        Given it’s an intepreter / virtual machine, it of course has limited APIs in the browser. For a while, it was not possible to access the DOM from WASM, so JS would do the DOM stuff and WASM was called (just like calling an external function in a lib in C/C++/Rust/…) upon to do computationally complex stuff since it was faster than running it in JS through the JS interpreter. IINM, WASM now does have access to the DOM.

        Of course there are WASM interpreters outside of browsers that can be included as libraries in other languages. Rust devs are using it for example for plugin systems in their software.

        CC BY-NC-SA 4.0