WASM 2.0
WASM 2.0 规范
↑ 跳转到目录→ 弹出侧边栏 light dark auto
WebAssembly Core Specification(WebAssembly 核心规范)
W3C Candidate Recommendation Draft,2024年12月18日 关于此文档的更多详细信息 本版本: https://www.w3.org/TR/2024/CRD-wasm-core-2-20241218/ 最新发布版本: https://www.w3.org/TR/wasm-core-2/ 编辑草案: https://webassembly.github.io/spec/core/bikeshed/ 历史: https://www.w3.org/standards/history/wasm-core-2/ 实现报告: https://webassembly.org/features/ 反馈: GitHub 编辑: Andreas Rossberg 问题追踪: GitHub Issues 版权 © 2024 World Wide Web Consortium。适用 W3C® 责任,商标 和 许可文档协议 规则。
摘要
本文档描述了核心 WebAssembly 标准的 2.0 版本,它是一种安全、可移植、低级的代码格式,旨在实现高效执行和紧凑表示。
这是相关文档集合的一部分:Core WebAssembly Specification,WebAssembly JS Interface 和 WebAssembly Web API。
本文档的状态
本节描述了本文档发布时的状态。当前的 W3C 出版物列表以及本技术报告的最新版本可以在 https://www.w3.org/TR/ 的 W3C 技术报告索引 中找到。
本文档由 WebAssembly Working Group 发布,作为使用 推荐轨道的 Candidate Recommendation Draft。
作为 Candidate Recommendation 发布并不意味着 W3C 及其成员的认可。Candidate Recommendation Draft 整合了 Working Group 打算包含在后续 Candidate Recommendation Snapshot 中的先前 Candidate Recommendation 中的更改。
WebAssembly Working group 打算在 Candidate Recommendation 状态下维护此出版物,并不断将其更新为“living standard”,而不是转换为 Recommendation 状态。 在任何情况下,都不会在 2025 年 1 月 17 日之前请求 REC 过渡。
GitHub Issues 是讨论此规范的首选方式。所有问题和评论都已 存档。
本文档会随时维护和更新。本文档的某些部分是正在进行的工作。
本文档由一个根据 W3C Patent Policy 运作的小组制作。W3C 维护着一份 与该小组交付成果相关的任何专利披露的公开列表;该页面还包括披露专利的说明。如果个人实际知晓其认为包含 Essential Claim(s) 的专利,则必须按照 W3C Patent Policy 的第 6 节 披露该信息。
本文档受 2023 年 11 月 3 日 W3C 流程文档 的约束。
目录
- 1 Introduction 1. 1.1 Introduction
- 2 Structure
1. 2.1 Conventions
- 2.1.1 Grammar Notation
- 2.1.2 Auxiliary Notation
- 2.1.3 Vectors 2. 2.2 Values
- 2.2.1 Bytes
- 2.2.2 Integers
- 2.2.3 Floating-Point
- 2.2.4 Vectors
- 2.2.5 Names 3. 2.3 Types
- 2.3.1 Number Types
- 2.3.2 Vector Types
- 2.3.3 Reference Types
- 2.3.4 Value Types
- 2.3.5 Result Types
- 2.3.6 Function Types
- 2.3.7 Limits
- 2.3.8 Memory Types
- 2.3.9 Table Types
- 2.3.10 Global Types
- 2.3.11 External Types 4. 2.4 Instructions
- 2.4.1 Numeric Instructions
- 2.4.2 Vector Instructions
- 2.4.3 Reference Instructions
- 2.4.4 Parametric Instructions
- 2.4.5 Variable Instructions
- 2.4.6 Table Instructions
- 2.4.7 Memory Instructions
- 2.4.8 Control Instructions
- 2.4.9 Expressions 5. 2.5 Modules
- 2.5.1 Indices
- 2.5.2 Types
- 2.5.3 Functions
- 2.5.4 Tables
- 2.5.5 Memories
- 2.5.6 Globals
- 2.5.7 Element Segments
- 2.5.8 Data Segments
- 2.5.9 Start Function
- 2.5.10 Exports
- 2.5.11 Imports
- 3 Validation
1. 3.1 Conventions
- 3.1.1 Contexts
- 3.1.2 Prose Notation
- 3.1.3 Formal Notation 2. 3.2 Types
- 3.2.1 Limits
- 3.2.2 Block Types
- 3.2.3 Function Types
- 3.2.4 Table Types
- 3.2.5 Memory Types
- 3.2.6 Global Types
- 3.2.7 External Types
- 3.2.8 Import Subtyping 3. 3.3 Instructions
- 3.3.1 Numeric Instructions
- 3.3.2 Reference Instructions
- 3.3.3 Vector Instructions
- 3.3.4 Parametric Instructions
- 3.3.5 Variable Instructions
- 3.3.6 Table Instructions
- 3.3.7 Memory Instructions
- 3.3.8 Control Instructions
- 3.3.9 Instruction Sequences
- 3.3.10 Expressions 4. 3.4 Modules
- 3.4.1 Functions
- 3.4.2 Tables
- 3.4.3 Memories
- 3.4.4 Globals
- 3.4.5 Element Segments
- 3.4.6 Data Segments
- 3.4.7 Start Function
- 3.4.8 Exports
- 3.4.9 Imports
- 3.4.10 Modules
- 4 Execution
1. 4.1 Conventions
- 4.1.1 Prose Notation
- 4.1.2 Formal Notation 2. 4.2 Runtime Structure
- 4.2.1 Values
- 4.2.2 Results
- 4.2.3 Store
- 4.2.4 Addresses
- 4.2.5 Module Instances
- 4.2.6 Function Instances
- 4.2.7 Table Instances
- 4.2.8 Memory Instances
- 4.2.9 Global Instances
- 4.2.10 Element Instances
- 4.2.11 Data Instances
- 4.2.12 Export Instances
- 4.2.13 External Values
- 4.2.14 Stack
- 4.2.15 Administrative Instructions 3. 4.3 Numerics
- 4.3.1 Representations
- 4.3.2 Integer Operations
- 4.3.3 Floating-Point Operations
- 4.3.4 Conversions 4. 4.4 Instructions
- 4.4.1 Numeric Instructions
- 4.4.2 Reference Instructions
- 4.4.3 Vector Instructions
- 4.4.4 Parametric Instructions
- 4.4.5 Variable Instructions
- 4.4.6 Table Instructions
- 4.4.7 Memory Instructions
- 4.4.8 Control Instructions
- 4.4.9 Blocks
- 4.4.10 Function Calls
- 4.4.11 Expressions 5. 4.5 Modules
- 4.5.1 External Typing
- 4.5.2 Value Typing
- 4.5.3 Allocation
- 4.5.4 Instantiation
- 4.5.5 Invocation
- 5 Binary Format
1. 5.1 Conventions
- 5.1.1 Grammar
- 5.1.2 Auxiliary Notation
- 5.1.3 Vectors 2. 5.2 Values
- 5.2.1 Bytes
- 5.2.2 Integers
- 5.2.3 Floating-Point
- 5.2.4 Names 3. 5.3 Types
- 5.3.1 Number Types
- 5.3.2 Vector Types
- 5.3.3 Reference Types
- 5.3.4 Value Types
- 5.3.5 Result Types
- 5.3.6 Function Types
- 5.3.7 Limits
- 5.3.8 Memory Types
- 5.3.9 Table Types
- 5.3.10 Global Types 4. 5.4 Instructions
- 5.4.1 Control Instructions
- 5.4.2 Reference Instructions
- 5.4.3 Parametric Instructions
- 5.4.4 Variable Instructions
- 5.4.5 Table Instructions
- 5.4.6 Memory Instructions
- 5.4.7 Numeric Instructions
- 5.4.8 Vector Instructions
- 5.4.9 Expressions 5. 5.5 Modules
- 5.5.1 Indices
- 5.5.2 Sections
- 5.5.3 Custom Section
- 5.5.4 Type Section
- 5.5.5 Import Section
- 5.5.6 Function Section
- 5.5.7 Table Section
- 5.5.8 Memory Section
- 5.5.9 Global Section
- 5.5.10 Export Section
- 5.5.11 Start Section
- 5.5.12 Element Section
- 5.5.13 Code Section
- 5.5.14 Data Section
- 5.5.15 Data Count Section
- 5.5.16 Modules
- 6 Text Format
1. 6.1 Conventions
- 6.1.1 Grammar
- 6.1.2 Abbreviations
- 6.1.3 Contexts
- 6.1.4 Vectors 2. 6.2 Lexical Format
- 6.2.1 Characters
- 6.2.2 Tokens
- [6.2.3 White Space](https://www.w3.org/TR/wasm-core-2/<