1

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.

hippietrail
  • 15,848
  • 18
  • 99
  • 158
Marcellvs
  • 391
  • 1
  • 3
  • 15

1 Answers1

2

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.

ColinE
  • 68,894
  • 15
  • 164
  • 232
  • 2
    I'd add another example of WebAssembly outside the browser as it relates to WASI. [Wasmtime](https://github.com/bytecodealliance/wasmtime) is a standalone Wasm runtime that can be run on a traditional OS, say Linux. So Wasmtime is the runtime and Linux is effectively the Host. – jonathanberi May 06 '20 at 11:38
  • Taking into account that the differences between compilers and interpreters are bleary, as there are on one hand JIT compilers and Interpreters with optimization on the other and then even something like compiling interpreters which are called compreters. So I would assume, to make things easy, that **Wasm code is generated by a compiler and interpreted to be translated into machine code** (probably without a lot of optimization). But regardless of the specifics, my question would be: **Is the interpreter core part of the runtime?** – Marcellvs May 06 '20 at 12:10