简体   繁体   中英

WebAssembly runtime vs. interpreter vs. engine

From webassembly.org :

WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine.

In the context of Wasm/WASI, what is

  • a WebAssembly runtime?
  • a WebAssembly interpreter?
  • a WebAssembly engine?

and in the above context:

  • the host environment?

I suppose the practical meaning of these terms can differ when used in a web browser context, but I think focus should be on the native usage of Wasm code.

I must admit, I preferred their previous summary of the technology:

WebAssembly or wasm is a new portable, size- and load-time-efficient format suitable for compilation to the web

To be specific WebAssembly is an instruction set, it looks quite like regular assembly language, with a low-level 'feel' to it. The language supports numeric types only, no strings, arrays etc...

The WebAssembly specification also defines the virtual machine that it runs on.

To answer your questions:

what is a WebAssembly runtime?

It is a machine, or virtual machine that can execute the WebAssembly instruction set, as described by the specification. You have one in your browser!

what is a WebAssembly interpreter?

Interpreters and compilers are two different approaches to executing a language - as described here:

How does an interpreter/compiler work

what is a WebAssembly engine?

Pretty much the same as a runtime.

the host environment?

WebAssembly runtimes typically live within a host - this is because WebAssembly itself cannot perform any I/O. In order to do something useful, it works with the host environment to achieve this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM