官术网_书友最值得收藏!

Definition and module overview

The binary format is defined as a dense linear encoding of the abstract syntax. Without getting too technical, that essentially means it's an efficient form of binary that allows for fast decoding, small file size, and reduced memory usage. The file representation of the binary format is a .wasm file, which will be the compilation output from Emscripten that we'll use for our examples.

The ValuesTypes, and Instructions subsections of the Core Specification for the binary format correlate directly to the Text Format section. Each of these concepts is covered in the context of encoding. For example, according to the specification, the Integer types are encoded using the LEB128 variable-length integer encoding, in either unsigned or signed variant. These are important details to know if you wish to develop tooling for WebAssembly, but not necessary if you just plan on using it on your website.

The Structure, Binary Format, and Text Format (wat) sections of the Core Specification have a Module subsection. We didn't cover aspects of the module in the previous section because it's more prudent to describe them in the context of a binary. The official WebAssembly site offers the following description for a module:

"The distributable, loadable, and executable unit of code in WebAssembly is called a module. At runtime, a module can be instantiated with a set of import values to produce an instance, which is an immutable tuple referencing all the state accessible to the running module."

We will discuss how to interact with the module using the JavaScript and Web APIs later in this chapter, so let's establish some context to understand how the module elements map to the API methods.

主站蜘蛛池模板: 仁怀市| 灵石县| 巢湖市| 乐亭县| 刚察县| 宁强县| 莒南县| 垦利县| 承德县| 澄城县| 白河县| 方山县| 盐津县| 隆昌县| 义马市| 保亭| 新龙县| 丹寨县| 新野县| 永春县| 德阳市| 巴马| 乌拉特中旗| 舟曲县| 阳江市| 南宁市| 融水| 抚宁县| 冷水江市| 磴口县| 威远县| 鸡泽县| 佛冈县| 平塘县| 拜城县| 芜湖县| 固镇县| 攀枝花市| 临夏县| 桂林市| 青阳县|