Introduction to WebAssembly
Karl Ritchie
December 2017
Contents
i. What is WebAssembly
ii. Goals of WebAssembly
iii.Workflow of WebAssembly
iv.Hello World in WebAssembly
v. Present and future of WebAssembly
vi.Conclusion
What is WebAssembly
 “WebAssembly or wasm is a new portable, size-
and load-time-efficient format suitable for
compilation to the web.”
 http://webassembly.org/
 In other words, WebAssembly makes it possible to compile
your code and run it on the Web(in a browser), similar to
JavaScript.
Goals of WebAssembly
 Goals :
 Portable
 Fast (Compiled and executed at near native speed)
 To make it easy to port your applications to the Web
 Currently C/C++ is main language targeted by WebAssembly
 http://webassembly.org/docs/high-level-goals/
Workflow of WebAssembly
 Simple and straight forward implementation workflow.
Hello World in WebAssembly
 Initial Setup :
 Follow the Getting Started page on WebAssembly’s Website and make sure
your environment is ready.
 http://webassembly.org/getting-started/developers-guide/
Hello World in WebAssembly
 1. Write the C function you want to run in your browser.
Hello World in WebAssembly
 2. Compile your code.
You should now see the .js “glue”
code file generated by the compiler
and the .wasm binary file in your
directory after compiling.
Hello World in WebAssembly
 3. Write some HTML/JavaScript.
Hello World in WebAssembly
 4. Try it !
Demo
Present and future of WebAssembly
 More important features are being planned, such as threading support and
also the enhancement of the developers’ tools.
 Recently (2017), current WebAssembly adoption as a Web standard as
been growing and being supported by major industry players.
 https://blog.mozilla.org/blog/2017/11/13/webassembly-in-browsers/
 Safe to assume that adoption rate should increase in upcoming
months/years and make it a stable and efficient tool for Web programming.
Conclusion
 In conclusion, WebAssembly is :
 Modern binary format intended to run on the Web
 A tool to easily integrate C/C++ into your Web app.
 A growing Web standard.
Questions ?

Quick overview of WebAssembly

  • 1.
    Introduction to WebAssembly KarlRitchie December 2017
  • 2.
    Contents i. What isWebAssembly ii. Goals of WebAssembly iii.Workflow of WebAssembly iv.Hello World in WebAssembly v. Present and future of WebAssembly vi.Conclusion
  • 3.
    What is WebAssembly “WebAssembly or wasm is a new portable, size- and load-time-efficient format suitable for compilation to the web.”  http://webassembly.org/  In other words, WebAssembly makes it possible to compile your code and run it on the Web(in a browser), similar to JavaScript.
  • 4.
    Goals of WebAssembly Goals :  Portable  Fast (Compiled and executed at near native speed)  To make it easy to port your applications to the Web  Currently C/C++ is main language targeted by WebAssembly  http://webassembly.org/docs/high-level-goals/
  • 5.
    Workflow of WebAssembly Simple and straight forward implementation workflow.
  • 6.
    Hello World inWebAssembly  Initial Setup :  Follow the Getting Started page on WebAssembly’s Website and make sure your environment is ready.  http://webassembly.org/getting-started/developers-guide/
  • 7.
    Hello World inWebAssembly  1. Write the C function you want to run in your browser.
  • 8.
    Hello World inWebAssembly  2. Compile your code. You should now see the .js “glue” code file generated by the compiler and the .wasm binary file in your directory after compiling.
  • 9.
    Hello World inWebAssembly  3. Write some HTML/JavaScript.
  • 10.
    Hello World inWebAssembly  4. Try it ! Demo
  • 11.
    Present and futureof WebAssembly  More important features are being planned, such as threading support and also the enhancement of the developers’ tools.  Recently (2017), current WebAssembly adoption as a Web standard as been growing and being supported by major industry players.  https://blog.mozilla.org/blog/2017/11/13/webassembly-in-browsers/  Safe to assume that adoption rate should increase in upcoming months/years and make it a stable and efficient tool for Web programming.
  • 12.
    Conclusion  In conclusion,WebAssembly is :  Modern binary format intended to run on the Web  A tool to easily integrate C/C++ into your Web app.  A growing Web standard.
  • 13.