Google, Microsoft, Mozilla And Others Team Up To Launch WebAssembly, A New Binary Format For The Web

This is pretty huge, if it doesn’t become vaporware. Basically, if this takes off it’s going to change the way we develop web apps entirely. Instead of writing everything in JavaScript, it will be written in whatever language you want and pre-compiled to a common bytecode that will be natively supported in your browser and ran under the same engine that runs JavaScript currently. So, kind of like the way Java Applets and Flash work… but not a 3rd party plugin, open source, and conforming to all the same security rules that JavaScript does.

Don’t get too caught up on the initial language being C++, I doubt that will last long. If it takes off, I’d expect all the popular languages to compile to the bytecode.


The new format is meant to allow programmers to compile their code for the browser (currently the focus is on C/C++, with other languages to follow), where it is then executed inside the JavaScript engine. Instead of having to parse the full code, though, which can often take quite a while (especially on mobile), WebAssembly can be decoded significantly faster


###WebAssembly High-Level Goals

  1. Define a portable, size- and load-time-efficient
    binary format to serve as a compilation target which
    can be compiled to execute at native speed by taking advantage of common
    hardware capabilities available on a wide range of platforms, including
    mobile and
    IoT.
  1. Specify and implement incrementally:
    • a Minimum Viable Product (MVP) for the standard with
      roughly the same functionality as asm.js, primarily
      aimed at C/C++;
    • an effective and efficient polyfill library for the
      MVP that translates WebAssembly code into JavaScript in the client so that
      WebAssembly MVP can run on existing browsers;
    • a follow-up to the MVP which adds several more
      essential features; and
    • additional features, specified iteratively and
      prioritized by feedback and experience, including support for languages
      other than C/C++.
  2. Design to execute within and integrate well with the existing
    Web platform:
    • maintain the versionless, feature-tested and
      backwards-compatible
      evolution story of the Web;
    • execute in the same semantic universe as JavaScript;
    • allow synchronous calls to and from JavaScript;
    • enforce the same-origin and permissions security policies;
    • access browser functionality through the same Web APIs that are accessible
      to JavaScript; and
    • define a human-editable text format that is convertible to and from the
      binary format, supporting View Source functionality.
  3. Design to support non-browser embeddings as well.
  4. Make a great platform:
    • build a new LLVM backend for WebAssembly and an accompanying
      clang port;
    • promote other compilers and tools targeting WebAssembly; and
    • enable other useful tooling.
2 Likes

Here are a couple more things I’ve seen since yesterday. I’m really excited about this, it’s kind of a big deal and if successful it will completely change the entire web development landscape. Even though I like JS, it’s goung to strike a big blow against it.


Something else I didn’t expect:

Will WebAssembly support View Source on the Web?

Yes! WebAssembly defines a text format to be rendered when developers view
the source of a WebAssembly module in any developer tool. Also, a specific goal of the text format
is to allow developers to write WebAssembly modules by hand for testing, experimenting, optimizing,
learning and teaching purposes. In fact, by dropping all the coercions required by asm.js
validation
, the WebAssembly text format should be much
more natural to read and write than asm.js. Outside the browser, command-line and online tools that
convert between text and binary will also be made readily available. Lastly, a scalable form of
source maps is also being considered as part of the WebAssembly tooling story.

https://github.com/WebAssembly/design/blob/master/FAQ.md#will-webassembly-support-view-source-on-the-web

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.