Let’s reinvent java bytecode but… different

  • Rikj000@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    20
    arrow-down
    2
    ·
    edit-2
    8 months ago

    WASM = WebAssembly,
    this has nothing to do with Java,
    but with JS (JavaScript).

    JS works with JIT (Just In Time) compilation, meaning every user that requests a web page, will request the JS and your browser will compile that JS on the fly as you request it.

    WASM on the other hand is pre-compiled once, by the developer, when he/she is making the code. So when a user requests a WASM binary, they don’t have to wait for JIT compilation, since it was already pre-compiled by the developer.

    They only have to wait for a tiny piece of JS,
    which is still JIT compiled,
    a tiny piece of JS to load in the WASM binary.

    This saves the user from waiting on JIT compilation and thus speeds up requesting web pages.

    WASM also increases security,
    since binaries are harder to reverse engineer then plain text JS.

    Due to those reasons,
    I believe WASM will be the future for Web development.

    No clue why people are hating on WASM,
    but I guess they just don’t grasp all of the above yet.

    • Sekoia@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      12
      ·
      8 months ago

      Having read a significant portion of the base WASM spec, it’s really quite a beautiful format. It’s well designed, clear, and very agnostic.

      I particularly like how sectioned it is, which allows different functions to be preloaded/parsed/whatever independently.

      It’s not perfect by any means; I personally find it has too many instructions, and the block-based control flow is… strange. But it fills a great niche as a standard low-level isolated programming layer.

    • lil@lemy.lol
      link
      fedilink
      arrow-up
      3
      ·
      8 months ago

      I want webpages to be open source, not compiled. That’s why I dislike WASM

      • Rikj000@discuss.tchncs.de
        link
        fedilink
        English
        arrow-up
        5
        ·
        8 months ago

        WASM projects can be open source,
        just like Android apps can be.

        However in both instances the compiled versions of it are not easily readable.

        Also you can validate binaries against a shasum to ensure no tampering has happened with them.

    • madkarlsson@beehaw.org
      link
      fedilink
      arrow-up
      2
      ·
      7 months ago

      WASM is great and as it becomes more accessible it will likely take over more and more

      OPs meme is just a sign of someone not understanding the softer parts around development. The meme also seems to forget that we tried java in the browser for two decades and it was just… Horrible from all perspectives, in all layers

    • onlinepersona@programming.devOP
      link
      fedilink
      arrow-up
      4
      arrow-down
      22
      ·
      8 months ago

      Wasm code (binary code, i.e. bytecode) is intended to be run on a portable virtual stack machine (VM)

      WASM wikipedia

      Java bytecode is the instruction set of the Java virtual machine (JVM), crucial for executing programs written in the Java language and other JVM-compatible languages

      java bytecode

      Need I say more?

      • dohpaz42@lemmy.world
        link
        fedilink
        English
        arrow-up
        10
        arrow-down
        1
        ·
        8 months ago

        Please do say more because I don’t think the argument you’re trying to make is coming across clearly. Obviously your intelligence is at a level far higher than us low-iq plebs, and we need your brilliant mastery of these topics to be poetically spelled out for us. For we are not worthy otherwise.

          • dohpaz42@lemmy.world
            link
            fedilink
            English
            arrow-up
            12
            arrow-down
            1
            ·
            8 months ago

            In all seriousness, everything. You post two out-of-context quotes from two different websites, but put no actual effort into tying them together and explaining your position on either side, and expect us to read your mind and agree with you. It’s a bad faith comment that exudes arrogance.