Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WebAssembly

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

 WebAssembly

Heraud Kevin

November 19, 2020

Transcript

30 slides
  1. 1992 HTML 2006 jQuery 2013 Vue.js, React, ... Virtual DOM

    1995 JavaScript 2009 AngularJS 2015 PWA
  2. 2013 : asm.js an extraordinarily optimizable, low-level subset of JavaScript

    https://blog.mozilla.org/futurereleases/2013/05/02/epic-citadel-demo-shows-the-power-of-the-web-as-a-platform-for-gaming
  3. Les objectifs fixés par WASM • Rapide : S'approche des

    performances du code natif • Sûr : “Memory-safe” et “sandboxing” • Indépendant : ◦ Du matériel ◦ Du langage ◦ De la plateforme • Se doter d’une représentation compact et efficace
  4. Indépendant .Net AssemblyScript Astro Brainfuck C C# C++ Clean Co

    COBOL D Eel Elixir F# Faust Forest Forth Go Grain Haskell Java JavaScript Julia Idris Kotlin/Native Kou Lobster Lua Lys Never Nim Ocaml Perl PHP Plorth Poetry Python Prolog Ruby Rust Scheme Scopes Swift TypeScript Wah Walt Wam WebAssembly Zig
  5. Comment : L’instanciation • “fetch” du fichier wasm depuis javascript

    • Chargement du fichier, compilation vers le langage machine (x86, arm, ...) et optimisations • Instanciation du module WASM • Appel des méthodes exposées
  6. Limitations • Impossible de manipuler directement le DOM depuis un

    module WASM : mapping des méthodes • L'intercommunication JavaScript <> WASM ne peut se faire que par 2 entiers ou 2 flottants : utilisation de la mémoire partagée en cas de “String” • Absence de “Garbage Collector”
  7. Use Cases • “Portage” d’applications (ffmpeg.wasm) • Jeux (Unity) •

    VR ou réalité augmentée • Simulations et visualisations scientifiques • Data Science (TensorFlow.js) • Emulation (QEMU, DOSBox, NES, Game Boy, ...) • Outillage orienté développement (IDE, ...) • Bureau à distance • DAO (Autocad) • Google Earth • Blockchain (Ethereum WebAssembly) • ...
  8. If WASM+WASI existed in 2008, we wouldn't have needed to

    created Docker. That's how important it is. Webassembly on the server is the future of computing. https://twitter.com/solomonstre/status/1111004913222324225
  9. Côté serveur : WASI • Bytecode Alliance, 2019 • WASI

    (WebAssembly System Interface) : ◦ Interface standard ◦ Permet d'interagir avec le monde extérieur (sanbox - I/O) • Permettra l'exécution d'une application sur n'importe quel système d'exploitation/architecture (runtime) https://hacks.mozilla.org/2019/03/standar dizing-wasi-a-webassembly-system- interface/
  10. Côté serveur : Runtime • Wasmer (Rust, C/C++, C#, Python,

    Go, R, PHP, ...), runtime ou intégration • wasmtime (Rust, C, Python, .NET et Go) • Lucet (compilateur et runtime) • Node.js (node-gyp) • Microsoft Blazor • GraalWasm • Serverless (Fassm) • ...

More Decks by Heraud Kevin

Other Decks in Technology