News for hackers. Stuff that matters.
Re:A world to win: WebAssembly for the rest of us by josephg on Friday August 18, 2023 @06:11AM (#37173578)
> Why would ByteBuffers be a horrible hack? Is it worse of a hack then what C compilers have to do when targeting WASM, like only having structured control flow?

Mmm maybe it is fine in java. I've spent a lot of time benchmarking javascript which has a similar set of primitives (typed arrays). I'm not sure how they perform now, but at the time they were always significantly slower than native javascript arrays for some reason.

> GraalVM actually has support for any LLVM language

Cool - I didn't know that! Thats definitely a point in the direction of the jvm being viable.

> Nonetheless, please don't take my possibly argumentative tone as a negative, I enjoy this discussion and you make great points.

I'm enjoying this too. For what its worth, at a big picture level I think it would definitely be technically possible to do what you're proposing. Its just a question of tradeoffs. Is it easier to tame a subset of java that could usefully fit in the browser, or just start fresh? The downside of starting fresh is that we'd need new compilers and optimizers. And the downside of using java is that the security story is much more complicated, and you'd need to figure out how much of the standard library to bring across and figure out how to secure the FFI.

Obviously the wasm team chose the latter. But perhaps if there were more java fans amongst browser vendors, or the choice was made decades ago, I could easily see the JVM being chosen instead of inventing wasm.

There are no comments on this comment yet.