WebAssembly
編程範型 | Pang-bô͘:Ill; Pang-bô͘:Ill[1] |
---|---|
軟體設計 | Pang-bô͘:Ill |
程式員 | |
首次發行 | 2017 年 3月 |
OS | Pang-bô͘:Ill |
軟體授權 | Pang-bô͘:Ill |
文件擴展名 |
|
啟發語言 | |
WebAssembly (
WebAssembly的
WebAssembly
規格 特色 [修改]
主機 環境[修改]
大馬 表示 [修改]
C元代碼 | WebAssembly .wat文本格式 | WebAssembly .wasm 2 |
---|---|---|
<syntaxhighlight lang="c"> int factorial(int n) { if (n == 0) return 1; else return n * factorial(n-1); } </syntaxhighlight> |
<syntaxhighlight lang="wat"> (func (param i64) (result i64) local.get 0 </syntaxhighlight> |
<syntaxhighlight lang="text"> 00 61 73 6D 01 00 00 00 01 00 01 60 01 73 01 73 06 03 00 01 00 02 0A 00 01 00 00 20 00 50 04 7E 42 01 05 20 00 20 00 42 01 7D 10 00 7E 0B 0B 15 17 </syntaxhighlight> |
<syntaxhighlight lang="wat">
(module
(type $t0 (func (param i64) (result i64))) (func $f0 (type $t0) (param $p0伊64) (result i64) (if $I0 (result i64) ;; $伊0 is an unused label name (伊64.eqz (local.get $p0)) ;; the name $p0 is the same as 0 here (then (伊64.const 1)) (else (伊64.mul (local.get $p0) (call $f0 ;; the name $f0 is the same as 0 here (伊64.sub (local.get $p0) (伊64.const 1))))))))
</syntaxhighlight>
註解 [修改]
- ↑ "WebAssembly/design/Semantics.md". GitHub (ēng Eng-gí). 2021-02-23 khòaⁿ--ê.
WebAssembly code can be considered a structured stack machine; a machine where most computations use a stack of values, but control flow is expressed in structured constructs such as blocks, ifs, and loops. 怹practice, implementations need not maintain an actual value stack, nor actual data structures for control; they need only behave as if they did so.
- ↑ Mozilla. "Understanding WebAssembly text format". MDN Web Docs. 9 December 2019 khòaⁿ--ê.
- ↑ "Introduction — WebAssembly 1.0". webassembly.github.腰. 18 June 2019 khòaⁿ--ê.
WebAssembly is an open standard...
- ↑ "Introduction — WebA ssembly 1.0". webassembly.github.腰. 18 June 2019 khòaⁿ--ê.
WebAssembly is a ... code format
- ↑ "Conventions — WebAssembly 1.0". webassembly.github.腰. 17 May 2019 khòaⁿ--ê.
WebAssembly is a programming language that has multiple concrete representations (its binary format and the text format)。 Both map to a common structure.
- ↑ "Introduction — WebAssembly 1.0". webassembly.github.腰. 18 June 2019 khòaⁿ--ê.
..。 this specification is complemented by additional documents defining interfaces to specific embedding environments such as the Web。 These will each define a WebAssembly application programming interface (API) suitable for a given environment.
- ↑ "Introduction — WebAssembly 1.1". webassembly.github.腰. 2021-02-19 khòaⁿ--ê.
Its main goal is to enable high performance applications on the Web, but it does not make any Web-specific assumptions or provide Web-specific features, so it can be employed in other environments as well.
- ↑ Haas, Andreas; Rossberg, Andreas; Schuff, Derek L.; Titzer, Ben L.; Holman, Michael; Gohman, Dan; Wagner, Luke; Zakai, Alon; Bastien, JF (14 June 2017). "Bringing the Web Up to Speed with WebAssembly". SIGPLAN Notices. 52 (6): 185–200. doi:10.1145/3140587.3062363. ISSN 0362-1340.
While the Web is the primary motivation for WebAssembly, nothing in its design depends on the Web or a JavaScript environment. It is an open standard specifically designed for embedding in multiple contexts, and we expect that stand-alone implementations will become available in the future.
- ↑ "Outside the web: standalone WebAssembly binaries using Emscripten ͘ V8". v8.dev. 2020-07-28 khòaⁿ--ê.
- ↑ "Wasmer - The Universal WebAssembly Runtime". wasmer.腰. 2021-02-19 khòaⁿ--ê.
Compile everything to WebAssembly。 Run it on any OS or embed it into other languages.
- ↑ World Wide Web Consortium. "WebAssembly Core Specification". World Wide Web Consortium (W3). 9 December 2019 khòaⁿ--ê.
- ↑ Couriol, Bruno. "WebAssembly 1.0 Becomes a W3C Recommendation and the Fourth Language to Run Natively in Browsers". infoq.com. 9 December 2019 khòaⁿ--ê.
- ↑ "WebAssembly Specification — WebAssembly 1.1". webassembly.github.腰. 2021-03-22 khòaⁿ--ê.
- ↑ "Programming Languages Software Award". www.sigplan.org.
- ↑ Bright, Peter (18 June 2015). "The Web is getting its bytecode: WebAssembly". Ars Technica. Condé Nast.
- ↑ "New Bytecode Alliance Brings the Security, Ubiquity, and Interoperability of the Web都the World of Pervasive Computing". Mozilla (ēng Eng-gí). 12 November 2019. 27 May 2019 khòaⁿ--ê.
參閱 [修改]
- Pang-bô͘:Ill (World Wide Web Consortium)
- Pang-bô͘:Ill
- Pang-bô͘:Ill
- Pang-bô͘:Ill (PNaCl)
- Pang-bô͘:Ill
- Pang-bô͘:Ill
外部 連結 [修改]
- Koaⁿ-hong bāng-chām (英語)
- W3C Community Group (英語)
- WebAssembly Design (英語)
- "WebAssembly", MDN Web Docs (ēng Eng-gí) – with info on browser compatibility and specifications (WebAssembly JavaScript API) (英語)