News for hackers. Stuff that matters.
Re:What Happened to WebAssembly by PunchyHamster on Friday January 09, 2026 @03:55AM (#46551556)
I start to think that's why there is still no DOM for the WASM and we have to pingping over JS

> Also the dirty secret of WebAssembly is that it's not really faster than JS.

That is near purely due to amount of work it took to make that shitty language run fast. Naive webassembly implementation will beat interpreted JS many times over but modern JIT implementations are wonder.

Re:What Happened to WebAssembly by gritzko on Friday January 09, 2026 @04:04AM (#46551617)
Yep. These things have been solved by massive investments. The question is, can WASM as a language (not an implementation) do something JavaScript can't?
Re:What Happened to WebAssembly by moralestapia on Friday January 09, 2026 @04:09AM (#46551658)
The answer to that is no. But innovating at the language level was never a goal for WASM; quite the opposite, as simple as possible so it can be compiled and run anywhere.
Re:What Happened to WebAssembly by CryZe on Friday January 09, 2026 @05:02AM (#46552073)
Wasm can do 64-bit integers, SIMD and statically typed GC classes.
Re:What Happened to WebAssembly by DonHopkins on Friday January 09, 2026 @09:57AM (#46554547)
WASM can even do 32-bit integers, which JavaScript can't, so uses floats instead.
Re:What Happened to WebAssembly by WorldMaker on Friday January 09, 2026 @11:54AM (#46555882)
JS has had byte arrays like Int32Array for a while. The JS engines will try to optimize math done into them/with them as integer math rather than float math, but yeah you still can't use an integer directly outside of array math.
Re:What Happened to WebAssembly by davidmurdoch on Friday January 09, 2026 @10:25AM (#46554849)
JS could have had support for SIMD and 64 bit it's by now, and progress was actually being made (mostly just through the asm.js experiments), but it was deprioritized specifically to work on WASM.
Re:What Happened to WebAssembly by moralestapia on Friday January 09, 2026 @04:00AM (#46551586)
Lol, I don't dislike JS but the reason why it's fast is because billions were poured into making that happen.

V8 is a modern engineering marvel.

Re:What Happened to WebAssembly by rob74 on Friday January 09, 2026 @04:06AM (#46551642)
Yeah, and like many engineering marvels, it was instantly misused for purposes its creators didn't intend and became a scourge on humanity (looking at you NodeJS & co).
Re:What Happened to WebAssembly by Findecanor on Friday January 09, 2026 @07:07AM (#46553033)
And WASM hasn't been around for as long, so WASM implementations are not as mature.

There is no reason why WASM couldn't be as fast, or faster than JS, especially now with WASM 3.0. Before, every programs in a managed language had to be shipped with its own GC and exception handling framework in WASM which was probably crippled by size constraints.

Re:What Happened to WebAssembly by pjmlp on Friday January 09, 2026 @07:34AM (#46553214)
They still need to, because WASM GC is a MVP that only covers a subset.

Any language with advanced GC algorithms, or interior pointers, will run poorly with current WASM GC.

It works as long as their GC model overlaps with JS GC requirements.

Re:What Happened to WebAssembly by WorldMaker on Friday January 09, 2026 @11:51AM (#46555826)
It's also currently only a subset of JS GC requirements at that. It's the bare minimum to share references between JS and WASM to byte arrays like Int32Array. It's like basic OS-level memory page sharing only for now.

Some of the real GC tests will be strings support (because immutability/interning) and higher-level composite objects, which is all still in various draft/proposal states.

Re:What Happened to WebAssembly by pjmlp on Friday January 09, 2026 @12:09PM (#46556079)
Oh, even worse than I thought.
Re:What Happened to WebAssembly by torginus on Friday January 09, 2026 @06:32AM (#46552756)
For WASM, the performance target isn't Javascript - but native code and NaCl. Considering WASM has had tremendously more time and effort invested into it, and still underperforms NaCl (and JS) signals to me that this is not the right approach.

The WASM runtime ended up from something that ingests pseudo-assembly,validates it and turns it into machine code, into a full-fledged multi-tiered JIT, like what JS has, with crazy engineering complexity per browser, and similar startup performance woes (which was one of the major goals of Nacl/Wasm to alleviate the load time issues with huge applications).

Re:What Happened to WebAssembly by 201984 on Friday January 09, 2026 @10:24AM (#46554844)
What does NaCl (seems to be some random crypto library?) have to do with this?
Re:What Happened to WebAssembly by torginus on Friday January 09, 2026 @10:30AM (#46554902)
Re:What Happened to WebAssembly by PunchyHamster on Friday January 09, 2026 @12:42PM (#46556568)
well, it could definitely be designed better.

Starting from not only single-threaded but memory-limited target was... weird decision

Re:What Happened to WebAssembly by WorldMaker on Friday January 09, 2026 @12:02PM (#46555995)
> I start to think that's why there is still no DOM for the WASM and we have to pingping over JS

I don't think you need conspiracy theories for that. DOM involves complex JS objects and you have to have an entirely working multi-language garbage collection model if you are expecting other languages to work with DOM objects otherwise you run the risk of memory leaking some of the most expensive objects in a browser.

That path to that is long and slow, especially with the various committees' general interest being in not requiring non-JS languages to entirely conform to JS GC (either implementing themselves on top of JS GC alone or having to implement their own complex subset of JS GC to interop correctly), so the focus has been on very low level tools over complex GC patterns. The first basics have only just been standardized. The next step (sharing strings) seems close but probably still has months to go. The steps after that (sharing simple structs) seem pretty complex with a lot of heated debate still to happen, and DOM objects are still some further complexity step past that (as they involve complex reference cycles and other such things).