Hacker News new | past | comments | ask | show | jobs | submit login

It is like Java bytecode, but design geared more towards supporting C.

Wasm in many ways is dumb. They could have easily adopted CLR or JVM bytecode. But no, the web is too "cool" for that. It's better to have a brand new VM that's slower and missing GC and a standard library.




The WASM instruction set is a tiny fraction of the size and complexity of the JVM and CLR instruction sets. One of WASM's primary design goals was to be able to prove safety and soundness properties for the language spec from the very beginning, and they've accomplished that [1]. Subjectively, I'd also argue that it is a much cleaner and more regular instruction set compared to JVM/CLR.

Because it has a lower level of abstraction than JVM/CLR (which, for example, have a built-in notion of what an "object" is, and every other language that you compile to it must have its own semantics shoehorned into that), WASM was able to become a good target for C, C++, and Rust.

The ultimate promise of WASM is that (given the right bindings) you can bring any C/C++/Rust codebase into the browser. E.g. see their demo of Doom running in the browser, utilizing WebGL bindings.

[1] https://www.cl.cam.ac.uk/~caw77/papers/mechanising-and-verif..., explainer video https://youtu.be/zsPVbmEPTlA


> missing GC and a standard library.

Many of us consider these points to be features. We don't want a runtime that's as complicated as CLR or JVM bytecode.


Any popular VM inevitably becomes as complex as those. Look at V8, it's grown into a JVM sized beast.

It would save countless hours of human effort to just adapt what's out there. It will be a decade before WASM has the kind of support JVM and CLR do. By then it will have the same huge codebase that causes vulnerabilities


Not an expert about anything related, but...

> It's better to have a brand new VM that's slower and missing GC and a standard library.

I can understand a desire to build something new and better suited for a particular goal.

Didn't Java execution in the browser(loosely speaking) used to be a thing? I remember that causing security issues, and JVM/Java seems like a large enough thing that trying to mold it into something it isn't seems strange to me.

As for the missing GC, I mostly work with Rust so that doesn't really bother me, although I could see how it would be an issue with other languages. Also, I believe WASI mentioned in the article is the standard library.


The web already adopted the JVM and Flash in the past and decided that it was a security disaster.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: