简体   繁体   English

WebAssembly 运行时 vs. 解释器 vs. 引擎

[英]WebAssembly runtime vs. interpreter vs. engine

From webassembly.org :来自webassembly.org

WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. WebAssembly(缩写为 Wasm)是一种用于基于堆栈的虚拟机的二进制指令格式。

In the context of Wasm/WASI, what is在 Wasm/WASI 的上下文中,什么是

  • a WebAssembly runtime? WebAssembly运行时?
  • a WebAssembly interpreter? WebAssembly解释器?
  • a WebAssembly engine? WebAssembly引擎?

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.我想这些术语的实际含义在 web 浏览器上下文中使用时可能会有所不同,但我认为重点应该放在 Wasm 代码的本机用法上。

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 WebAssembly 或 wasm 是一种新的可移植、节省大小和加载时间的格式,适用于编译到 web

To be specific WebAssembly is an instruction set, it looks quite like regular assembly language, with a low-level 'feel' to it.具体来说,WebAssembly 是一个指令集,它看起来很像普通的汇编语言,带有一种低级的“感觉”。 The language supports numeric types only, no strings, arrays etc...该语言仅支持数字类型,不支持字符串,arrays 等...

The WebAssembly specification also defines the virtual machine that it runs on. WebAssembly 规范还定义了它运行的虚拟机。

To answer your questions:要回答您的问题:

what is a WebAssembly runtime?什么是 WebAssembly 运行时?

It is a machine, or virtual machine that can execute the WebAssembly instruction set, as described by the specification.如规范中所述,它是可以执行 WebAssembly 指令集的机器或虚拟机。 You have one in your browser!您的浏览器中有一个!

what is a WebAssembly interpreter?什么是 WebAssembly 解释器?

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?什么是 WebAssembly 引擎?

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. WebAssembly 运行时通常存在于主机中——这是因为 WebAssembly 本身无法执行任何 I/O。 In order to do something useful, it works with the host environment to achieve this.为了做一些有用的事情,它与宿主环境一起工作来实现这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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