Mark As Completed Discussion

This is a summary of the original WebAssembly whitepaper, which can be found at this link.

Abstract

  • The maturation of the Web platform has given rise to sophisticated and demanding Web applications.
  • With that, efficiency and security of code on the Web have become more important than ever. Yet JavaScript as the only builtin language of the Web is not well-equipped to meet these requirements.
  • Engineers from the four major browser vendors have risen to the challenge and collaboratively designed a portable low-level bytecode called WebAssembly.
  • WebAssembly offers compact representation, efficient validation and compilation, and safe low to no-overhead execution.
  • WebAssembly is an abstraction over modern hardware, making it language-, hardware-, and platform-independent.

1. Introduction

  • The Web began as a simple document exchange network but has now become the most ubiquitous application platform.
  • JavaScript is the only natively supported programming language on the Web, its widespread usage unmatched by other technologies available only via plugins like ActiveX, Java, or Flash. Because of JavaScript's ubiquity, rapid performance improvements in modern VMs, and perhaps through sheer necessity, it has become a compilation target for other languages.
  • Still, JavaScript has inconsistent performance and several other pitfalls, especially as a compilation target.
  • WebAssembly addresses the problem of safe, fast, portable low-level code on the Web.
    1. Safe, fast, and portable semantics
    2. Safe and efficient representation
  • Safe
    1. Safety for mobile code is paramount on the Web.
    2. Since code originates from untrusted sources. Protection for mobile code has traditionally been achieved by providing a managed language runtime such as the browser's JavaScript VM or a language plugin. Managed languages enforce memory safety, preventing programs from compromising user data or system state.
  • Fast
    1. Low-level code like that emitted by a C/C++ compiler is typically optimized ahead-of-time.
    2. Native machine code, either written by hand or as the output of an optimizing compiler can utilize the full performance of a machine.
  • Portable

    1. The Web spans not only many device classes, but different machine architectures, operating systems, and browsers.
    2. Code targeting the Web must be hardware- and platform-independent to allow applications to run across all browsers and hardware types.
  • Compact

    1. The code that is transmitted over the network should be compact.
    2. Compact code can reduce load times, save potentially expensive bandwidth, and improve overall responsiveness.
  • Prior Attempts at Low-level Code on the Web
    1. Microsoft's ActiveX was a technology for code-signing x86 binaries to run on the Web.
    2. Native Client was the first system to introduce a sandboxing technique for machine code on the Web that runs at near-native speed.
    3. Emscripten is a framework for compiling mostly unmodified C/C++ applications to JavaScript and linking them with an execution environment implemented in JavaScript.
  • Contributions
    1. WebAssembly is the first industrial-strength language or VM that has been designed with a formal semantics from the start.
    2. While the Web is the primary motivation for WebAssembly, nothing in its design depends on the Web or a JavaScript environment.
    3. It is the result of an unprecedented collaboration across major browser vendors and an online community group to build a common solution for high-performance applications.