Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
An Intro toAn Intro to
WebAssemblyWebAssembly
Daniel BuddenDaniel Budden
@danlbudden@danlbudden
WebAssemblyWebAssembly
•
The next evolutionary step of asm.js &The next evolutionary step of asm.js &
EmscriptenEmscripten...
What is it?What is it?
•
It's not JavaScriptIt's not JavaScript
•
A new Abstract Syntax Tree format with aA new Abstract S...
Benefits over asm.jsBenefits over asm.js
•
Parsing the asm.js code becomes the bottleneckParsing the asm.js code becomes t...
Is it trying to replace JS?Is it trying to replace JS?
•
The aim is provide a new tool that complimentsThe aim is provide ...
Potential ApplicationsPotential Applications
•
Some potential applications:Some potential applications:
•
Games,Games,
•
A...
Writing WebAssemblyWriting WebAssembly
•
WebAssembly will have a text formatWebAssembly will have a text format
•
Emscript...
RoadmapRoadmap
•
Develop polyfillDevelop polyfill
•
Implement MVPImplement MVP
•
Post-MVP extensionPost-MVP extension
•
Di...
PolyfillPolyfill
•
WebAssembly will be:WebAssembly will be:
•
Backwards compatibleBackwards compatible
•
No versioningNo v...
Prototype PolyfillPrototype Polyfill
.wasm file
asm.js code
Polyfill
Execute
Promise
Web Worker
Resolve
Minimum Viable ProductMinimum Viable Product
•
Define the binary format, AST structure and textDefine the binary format, A...
Post-MVP ExtensionPost-MVP Extension
•
Extend the MVP implementation by adding:Extend the MVP implementation by adding:
•
...
Future FeaturesFuture Features
•
Support for other languages:Support for other languages:
•
E.g. Haskell, Go, Rust, C#E.g....
WebAssembly DemoWebAssembly Demo
Further ReadingFurther Reading
•
JSZap - Benefits of compressed AST:JSZap - Benefits of compressed AST:
http://research.mi...
Getting InvolvedGetting Involved
•
https://github.com/WebAssemblyhttps://github.com/WebAssembly
•
https://www.w3.org/commu...
Questions?Questions?
Daniel BuddenDaniel Budden
@danlbudden@danlbudden
https://github.com/d3spis3dhttps://github.com/d3spi...
Upcoming SlideShare
Loading in …5
×

An Introduction to WebAssembly

1,994 views

Published on

Talk I gave at MelbJS, introducing WebAssembly, the current state of development, and the future for the technology.

Published in: Software
  • HI Thanks Pls add FSharp F# to Future Features Support for other languages https://functionalprogramming.slack.com/messages/fsharp_to_wasm/search/fsharp%20ast/
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

An Introduction to WebAssembly

  1. 1. An Intro toAn Intro to WebAssemblyWebAssembly Daniel BuddenDaniel Budden @danlbudden@danlbudden
  2. 2. WebAssemblyWebAssembly • The next evolutionary step of asm.js &The next evolutionary step of asm.js & EmscriptenEmscripten • Announced 17Announced 17thth June 2015June 2015 • Being developed by a W3C Community GroupBeing developed by a W3C Community Group involving Chrome, Firefox, Safari and Edgeinvolving Chrome, Firefox, Safari and Edge developersdevelopers
  3. 3. What is it?What is it? • It's not JavaScriptIt's not JavaScript • A new Abstract Syntax Tree format with aA new Abstract Syntax Tree format with a binary encodingbinary encoding • Designed to run in multiple environments:Designed to run in multiple environments: browser, node.js, and elsewherebrowser, node.js, and elsewhere
  4. 4. Benefits over asm.jsBenefits over asm.js • Parsing the asm.js code becomes the bottleneckParsing the asm.js code becomes the bottleneck • Binary encoding benefits parsing and transmissionBinary encoding benefits parsing and transmission • WebAssembly will diverge from JavaScript and asm.js, e.g:WebAssembly will diverge from JavaScript and asm.js, e.g: • Shared memory multithreadingShared memory multithreading • call/cccall/cc
  5. 5. Is it trying to replace JS?Is it trying to replace JS? • The aim is provide a new tool that complimentsThe aim is provide a new tool that compliments JavaScriptJavaScript • Also to remove the burden of JavaScript as aAlso to remove the burden of JavaScript as a cross-compilation target.cross-compilation target.
  6. 6. Potential ApplicationsPotential Applications • Some potential applications:Some potential applications: • Games,Games, • Audio/Video/Virtual Reality,Audio/Video/Virtual Reality, • Peer-to-peer, e.g. collaborative editing,Peer-to-peer, e.g. collaborative editing, • Encryption,Encryption, • CAD software,CAD software, • Scientific simulation and visualisationScientific simulation and visualisation • Machine LearningMachine Learning
  7. 7. Writing WebAssemblyWriting WebAssembly • WebAssembly will have a text formatWebAssembly will have a text format • Emscripten will have an option to produceEmscripten will have an option to produce .wasm file instead of asm.js.wasm file instead of asm.js • Other cross-compilers will be developed forOther cross-compilers will be developed for languages other than C/C++languages other than C/C++
  8. 8. RoadmapRoadmap • Develop polyfillDevelop polyfill • Implement MVPImplement MVP • Post-MVP extensionPost-MVP extension • Diverge from JS/asm.jsDiverge from JS/asm.js
  9. 9. PolyfillPolyfill • WebAssembly will be:WebAssembly will be: • Backwards compatibleBackwards compatible • No versioningNo versioning • Feature detectionFeature detection
  10. 10. Prototype PolyfillPrototype Polyfill .wasm file asm.js code Polyfill Execute Promise Web Worker Resolve
  11. 11. Minimum Viable ProductMinimum Viable Product • Define the binary format, AST structure and textDefine the binary format, AST structure and text formatformat • Support C and C++Support C and C++ • Roughly the same functionality as asm.jsRoughly the same functionality as asm.js
  12. 12. Post-MVP ExtensionPost-MVP Extension • Extend the MVP implementation by adding:Extend the MVP implementation by adding: • ThreadsThreads • Short SIMDShort SIMD • Zero-cost ExceptionsZero-cost Exceptions
  13. 13. Future FeaturesFuture Features • Support for other languages:Support for other languages: • E.g. Haskell, Go, Rust, C#E.g. Haskell, Go, Rust, C# • Long SIMDLong SIMD • Dynamic Linking of WebAssembly ModulesDynamic Linking of WebAssembly Modules • Multithreading with shared memoryMultithreading with shared memory • Garbage CollectionGarbage Collection • Integration with DOM and Web APIsIntegration with DOM and Web APIs
  14. 14. WebAssembly DemoWebAssembly Demo
  15. 15. Further ReadingFurther Reading • JSZap - Benefits of compressed AST:JSZap - Benefits of compressed AST: http://research.microsoft.com/apps/pubs/http://research.microsoft.com/apps/pubs/ ?id=120832?id=120832
  16. 16. Getting InvolvedGetting Involved • https://github.com/WebAssemblyhttps://github.com/WebAssembly • https://www.w3.org/community/webassemblyhttps://www.w3.org/community/webassembly //
  17. 17. Questions?Questions? Daniel BuddenDaniel Budden @danlbudden@danlbudden https://github.com/d3spis3dhttps://github.com/d3spis3d

×