SUPPORT THE WORK

GetWiki

WebAssembly

ARTICLE SUBJECTS
aesthetics  →
being  →
complexity  →
database  →
enterprise  →
ethics  →
fiction  →
history  →
internet  →
knowledge  →
language  →
licensing  →
linux  →
logic  →
method  →
news  →
perception  →
philosophy  →
policy  →
purpose  →
religion  →
science  →
sociology  →
software  →
truth  →
unix  →
wiki  →
ARTICLE TYPES
essay  →
feed  →
help  →
system  →
wiki  →
ARTICLE ORIGINS
critical  →
discussion  →
forked  →
imported  →
original  →
WebAssembly
[ temporary import ]
please note:
- the content below is remote from Wikipedia
- it has been imported raw for GetWiki
{{Use dmy dates|date=March 2016}}{{Short description|binary format for executables used by web pages}}







factoids
| latest release version = | latest release date = Type system>Static| scope = | implementations = | dialects = asm.jsGoogle Native Client>PNaCl}}| influenced = | programming language = | license = Apache License 2.0.wat|.wasm}}| file format = }}WebAssembly (often shortened to Wasm) is an open standard that defines a portable binary code format for executable programs, and a corresponding textual assembly language, as well as interfaces for facilitating interactions between such programs and their host environment.WEB,weblink Introduction — WebAssembly 1.0, webassembly.github.io, 2019-06-18, WebAssembly is an open standard..., WEB,weblink Introduction — WebAssembly 1.0, webassembly.github.io, 2019-06-18, WebAssembly is a ... code format, WEB,weblink Conventions — WebAssembly 1.0, webassembly.github.io, 2019-05-17, WebAssembly is a programming language that has multiple concrete representations (its binary format and the text format). Both map to a common structure., WEB,weblink Introduction — WebAssembly 1.0, webassembly.github.io, 2019-06-18, ... 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., The main goal of WebAssembly is to enable high performance applications on web pages, but the format is designed to be executed and integrated in other environments as well.WEB,weblink WebAssembly Specification Release 1.0 (Draft, last updated Apr 16, 2019): Introduction, webassembly.org, 2019-05-06, 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., JOURNAL, Haas, Andreas, Rossberg, Andreas, Schuff, Derek L., Titzer, Ben L., Holman, Michael, Gohman, Dan, Wagner, Luke, Zakai, Alon, Bastien, JF, 2017-06-14, Bringing the Web Up to Speed with WebAssembly,weblink SIGPLAN Not., 52, 6, 185–200, 10.1145/3140587.3062363, 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., Wasm does not replace JavaScript; in order to use Wasm in browsers, users may use Emscripten SDK to compile C++ (or any other LLVM-supported language such as D or Rust) source code into a binary file which runs in the same sandbox as regular JavaScript code;{{Refn|group=note|According to official documentation the Emscripten SDK may be used to create .wasm files which then may be executed in web browser.WEB,weblink Developer’s Guide - WebAssembly, webassembly.org, 2019-06-10, WEB,weblink Compiling a New C/C++ Module to WebAssembly, MDN Web Docs, en, 2019-06-10, WEB,weblink Building to WebAssembly — Emscripten 1.38.33 documentation, emscripten.org, 2019-06-10, Even though Emscripten can consume various languages when using Clang some problems may arise.WEB,weblink Emscripting a C library to Wasm {{!, Web|website=Google Developers|language=en|access-date=2019-06-10}}}} Emscripten provides bindings for several commonly used environment interfaces like WebGL; it has access only to an expandable memory and a small number of scalar values.{{Clarify|reason=Specify which environment.|date=June 2019}}{{Citation needed|date=June 2019}} There is no direct Document Object Model (DOM) access; however, it is possible to create proxy functions for this, for example through stdweb,WEB,weblink stdweb - Rust, docs.rs, 2019-06-05, The goal of this crate is to provide Rust bindings to the Web APIs and to allow a high degree of interoperability between Rust and JavaScript., web_sys,WEB,weblink web_sys - Rust, docs.rs, 2019-06-05, Raw API bindings for Web APIs. This is a procedurally generated crate from browser WebIDL which provides a binding to all APIs that browser provide on the web., and js_sys.WEB,weblink js_sys - Rust, docs.rs, 2019-06-05, Bindings to JavaScript's standard, built-in objects, including their methods and properties., The World Wide Web Consortium (W3C) maintains the standard with contributions from Mozilla, Microsoft, Google, and Apple.

History

WebAssembly was first announced in 2015, and the first demonstration was executing Unity's Angry Bots in Firefox, Google Chrome, and Microsoft Edge. The precursor technologies were asm.js from Mozilla and Google Native Client, and the initial implementation was based on the feature set of asm.js.In March 2017, the design of the minimum viable product (MVP) was declared to be finished and the preview phase ended. {{As of|2017|September|alt=In late September 2017}}, Safari 11 was released with support. In February 2018, the WebAssembly Working Group published three public working drafts for the Core Specification, JavaScript Interface, and Web API.

Support

In November 2017, Mozilla declared support "in all major browsers" (by now all major on mobile and desktop), after WebAssembly was enabled by default in Edge 16. The support includes mobile web browsers for iOS and Android. {{As of|2018|08}}, 86.72% of installed browsers (88.82% of desktop browsers and 86.64% of mobile browser) support WebAssembly.But for older browsers, Wasm can be compiled into asm.js by a JavaScript polyfill.Because WebAssembly executables are precompiled, it is possible to use a variety of programming languages to make them. This is achieved either through direct compilation to Wasm, or through implementation of the corresponding virtual machines in Wasm. There have been around 40 programming languages reported to support Wasm as a compilation target.Emscripten can compile C and C++ to Wasm using LLVM in the backend.Its initial aim is to support compilation from C and C++, though support for other source languages such as Rust and .NET languages is also emerging.WEB,weblink Frequently asked questions (FAQ) about Blazor, blazor.net, 2018-06-18, After the MVP release, there are plans to support multithreading and garbage collectionWEB,weblink 🛤 Garbage collection · Issue #16 · WebAssembly/proposals, GitHub, en, 2019-07-25, which would make WebAssembly a compilation target for garbage-collected programming languages like C# (supported via Blazor) and F# (supported via BoleroWEB,weblink Bolero: F# in WebAssembly, fsbolero.io, 2019-07-25, with help of Blazor); Java, Julia,WEB,weblink Julia in the Browser, nextjournal.com, 2019-04-09, WEB,weblink WebAssembly platform by tshort · Pull Request #2 · JuliaPackaging/Yggdrasil, GitHub, en, 2019-04-09, {{Citation|last=Fischer|first=Keno|title=Running julia on wasm. Contribute to Keno/julia-wasm development by creating an account on GitHub|date=2019-07-22|url=https://github.com/Keno/julia-wasm|access-date=2019-07-25}} Ruby,WEB,weblink MRuby in Your Browser, ruby.dj, 2019-07-25, as well as Go.

Use by malware

The method of delivery and execution of WebAssembly code allows malware writers, scammers and phishing attackers greater ease in hiding the evidence of their attack. In addition, WebAssembly is only present on the user's machine in its compiled form, which is inherently hard to analyze in order to identify malicious code.WEB, Lonkar, Aishwarya, Chandrayan, Siddhesh, The dark side of WebAssembly,weblink Virus Bulletin, 8 June 2019, October 2018, The speed and concealability of WebAssembly have led to its use in cryptomining attacks.WEB, Segura, Jérôme, Persistent drive-by cryptomining coming to a browser near you,weblink Malwarebytes, 8 June 2019, November 29, 2017, WEB, Neumann, Robert, Toro, Abel, In-browser mining: Coinhive and WebAssembly,weblink Forcepoint, 8 June 2019, en, 19 April 2018, Coinhive, a service facilitating cryptocurrency mining in website visitors' browsers claims their "miner uses WebAssembly and runs with about 65% of the performance of a native Miner."In June 2018, a security researcher presented the possibility of using WebAssembly to circumvent browser mitigations for Spectre and Meltdown security vulnerabilities once support for threads with shared memory is added. Due to this concern, WebAssembly developers put the feature on hold.WEB, Cimpanu, Catalin, Changes in WebAssembly Could Render Meltdown and Spectre Browser Patches Useless,weblink Bleeping Computer, 8 June 2019, en-us, 24 June 2018, WEB, Sanders, James, How opaque WebAssembly code could increase the risk of Spectre attacks online,weblink Tech Republic, 9 June 2019, en, June 25, 2018, Thread support was eventually added in October 2018.WEB, R, Bhagyashree, Google Chrome 70 now supports WebAssembly threads to build multi-threaded web applications,weblink Packt, Packt Pub, 9 June 2019, 30 October 2018, {{Anchor|Beyond the Browser}}

Embedding

The general standards provide core specifications for JavaScript and Web embedding.While WebAssembly was initially designed to enable near-native code execution speed in the web browser, it has been considered valuable outside of such, in more generalized contexts.WEB,weblink Non-Web Embeddings, WebAssembly, 2019-05-15, WEB,weblink Non-Web Embeddings, GitHub / WebAssembly, 2019-05-15, WebAssembly System Interface (WASI) is an ABI designed by Mozilla intended to define a simpler ABI for WebAssembly that can be used in any platform.WEB,weblink WebAssembly System Interface Repo, GitHub / WebAssembly, There are also a few other proposed ABI APIs.WEB,weblink reference-sysroot Repo, GitHub / WebAssembly, WEB,weblink wasm-c-api Repo, GitHub / WebAssembly,

Features

Stack machine

Wasm code is intended to be run on a portable abstract structured virtual stack machine (VM). The VM is designed to be faster to parse than JavaScript, as well as faster to execute and to enable very compact code representation.

Instruction set

The core standard defines a unique Instruction Set Architecture consisting of specific binary encoding and which is intended to be executed by VM. However it doesn't specify how exactly they must be invoked by it.WEB,weblink Introduction — WebAssembly 1.0, webassembly.github.io, 2019-05-17,

Representation

In March 2017, the WebAssembly Community Group reached consensus on the initial (MVP) binary format, JavaScript API, and reference interpreter. It defines a WebAssembly binary format, which is not designed to be used by humans, as well as a human-readable linear assembly bytecode format that resembles traditional assembly languages.The table below represents three different views of the same source code input from the left, as it is converted to a Wasm intermediate representation, then to Wasm binary instructions:{| class="wikitable"! C input source !! Linear assembly bytecode (intermediate representation) !! Wasm binary encoding (hexadecimal bytes) style="vertical-align:top"|int factorial(int n) {
if (n == 0)
return 1;
else
return n * factorial(n-1);
}get_local 0i64.eqzif (result i64)
i64.const 1
else
get_local 0
get_local 0
i64.const 1
i64.sub
call 0
i64.mul
end20 005042 0120 0020 0042 017D10 007EThe WebAssembly text format can also be written in a folded format using s-expressions. This format is purely syntactic sugar and has no behavioral differences with the linear format. An example is shown below:(module
(import "math" "exp" (func $exp (param f64) (result f64)))
(func (export "doubleExp") (param $0 f64) (result f64)
(f64.mul
(call $exp
(get_local $0)
)
(f64.const 2)
)
)
)

Literature

  • JOURNAL, Andreas, Haas, Andreas, Rossberg, Derek L., Schuff, Ben L., Titzer, Dan, Gohman, Luke, Wagner, Alon, Zakai, JF, Bastien, Michael, Holman, June 2017, Bringing the web up to speed with WebAssembly,weblink Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, Association for Computing Machinery, 185–200, 10.1145/3062341.3062363,
  • JOURNAL, Watt, Conrad, 2018, Mechanising and Verifying the WebAssembly Specification,weblink ACM SIGPLAN International Conference on Certified Programs and Proofs, ACM, 7, 10.1145/3167082,

Notes

{{reflist|group=note}}

References

{{Free-content attribution||title= Text Format|author = jfbastien; rossberg-chromium; kripken; titzer; s3ththompson; sunfishcode; lukewagner; flagxor; enricobacis; c3d; binji; andrewosh|publisher = GitHub|source= WebAssembly/design|documentURL=weblink|license statement URL=weblink|license= Apache License 2.0}}

Demo

  • Widgets demo: weblink with NWSTK
  • 3D mountain geometry synthesis demo: weblink with NWSTK
  • Demo for loading and drawing a jpg file: weblink with NWSTK

External links

{{Web browsers|fsp}}{{Web interfaces}}{{JavaScript}}

- content above as imported from Wikipedia
- "WebAssembly" does not exist on GetWiki (yet)
- time: 5:11am EDT - Sun, Aug 25 2019
[ this remote article is provided by Wikipedia ]
LATEST EDITS [ see all ]
GETWIKI 09 JUL 2019
Eastern Philosophy
History of Philosophy
GETWIKI 09 MAY 2016
GETWIKI 18 OCT 2015
M.R.M. Parrott
Biographies
GETWIKI 20 AUG 2014
GETWIKI 19 AUG 2014
CONNECT