Live data from Hacker News

Wasmtime 1.0: A Look at Performance

bytecodealliance.org

21–23 of 23 posts

Re: Wasmtime 1.0: A Look at Performance

#21
post #7

Earlier quoted context omitted.

Ignoring security for a moment: Say you want to write a web application in Rust. You want to ship your web application to your users. You don't want your users to have to wait for the whole application to compile and download all dependencies; you want to ship some precompiled stuff. What do you ship? We could have some web standard where we ship native code to the user, which the user's machine then executes directl…

> The alternative is that we have some specification for intermediate code which is low level enough to be a universal compile target but abstract enough to be possible to compile to essentially any CPU architecture. That's what WASM is. Isn't that exactly what Java did years ago? And what Microsoft's .NET bytecode did when they had to remove the Microsoft JVM? Standard WASM is stack based, unlike every real computer…

Sorry, I was responding to this:

> what's the point of taking machine code capable software, compiling it into WASM, and then compiling that back into machine code?

That's where the proliferation of instruction sets and instruction set versions is relevant. My comment wasn't trying to address the Java/.NET part of your question.

My response to "Why not Java bytecode" is here: https://news.ycombinator.com/item?id=32743910. I don't know enough about the design of the CLR to comment. In any case, neither Java bytecode nor CLR bytecode are proper open standards, so they seem like bad fits for the web unless Microsoft or Oracle wanted to lead an effort to turn them into web standards.

I don't have enough experience with compiler back-end theory to respond intelligently to what sort of challenges and benefits a stack-based IR represents, but I know that you can view a stack language as a language with arbitrarily many registers, which you can translate into SSA form, which lets you do efficient register allocation, so I imagine the stack-based nature might be okay? I agree that allowing unaligned memory access seems like an issue, but I suppose the alternative there is to have different alignment requirements per architecture, which hurts interoperability. I'd love to hear from WASM implementers whether this causes problems in practice or not.

Re: Wasmtime 1.0: A Look at Performance

#22
post #7

Earlier quoted context omitted.

Ignoring security for a moment: Say you want to write a web application in Rust. You want to ship your web application to your users. You don't want your users to have to wait for the whole application to compile and download all dependencies; you want to ship some precompiled stuff. What do you ship? We could have some web standard where we ship native code to the user, which the user's machine then executes directl…

> The alternative is that we have some specification for intermediate code which is low level enough to be a universal compile target but abstract enough to be possible to compile to essentially any CPU architecture. That's what WASM is. Isn't that exactly what Java did years ago? And what Microsoft's .NET bytecode did when they had to remove the Microsoft JVM? Standard WASM is stack based, unlike every real computer…

I feel the JVM bytecode was not universal compile target where WebAssembly is. JVM target was hand-in-hand with Java the language, both owned by Sun, later litigation happy Oracle. Java was a political problem, plus also a security problem due to its various exploits. Thus, I feel it is incorrect to say Java the compile target solved anything (thought the language found a niche use case at server software later).

Some use case outside browsers are edge computing and distributing binaries (for computation efficiency) with NPM packages. For example, distributing cryptographic libraries as Wasm instead of error prone reimplementation in JS.

Re: Wasmtime 1.0: A Look at Performance

#23
post #17
post #8

Earlier quoted context omitted.

JVM bytecode is, to my understanding, basically just a serialized, desugared Java. It has a concept of classes with constructors and it has objects and references and inheritance and basically all of Java's semantics encoded in it. Languages which aren't "java-like" have a hard time compiling to it. WASM, on the other hand, is more like machine code, so languages which are used to compiling to machine code have a fai…

Indeed, not to mention the GC, which isn't one size fits all (not even within Java itself). And wasm could run in ring 0 if you want, the runtime is that hardened.

You can “already” run Wasm modules in kernel to speed up things

https://github.com/wasmerio/kernel-wasm

Post reply on HN