WebAssembly новая, но быстро развивающаяся технология, которая поддерживается всеми основными браузерами. Из доклада вы узнаете, что такое WebAssembly, для чего это нужно и чем это отличается от JavaScript. В докладе так же будут рассмотрены вопросы, когда лучше применять WebAssembly, а когда лучше остановится на JavaScript.
14. • Announced in 17 June 2015
• Supported by major Browsers
• Developed by WebAssembly Working
Group (W3C)
• Draft specific published 15 Feb 2018
WebAssembly – New Hope
26. WASM WILL BRING TO WEB
• High performance
• New languages
• Variety of existed libraries
27. WHAT'S NEW IN THE WEB
• New types of applications will appear in Web
• graphical, video and audio editors
• games that fully consume CPU power
• other performance intensive application in browser
• New languages will be run in Browser and NodeJS
62. EXECUTION
slow at start
threads - workers
no native threads
GC
1.2 of native speed
threads – workers
native threads - future
no GC now
63. EXECUTION
many types
access to DOM
access to Web API
access to JS functions
only 4 primitive types
no access to DOM
no access to Web API
access to JS functions
69. BUILD TARGET FOR
• C/C++
• Rust
• C# - Mono and CoreRT
• Go
• BrainFuck
• Even more: https://github.com/appcypher/awesome-wasm-langs
70. VM
• Blazor: NET code in the browser via the Mono runtime, which itself is
compiled to WebAssembly and asm.js (Steve Sanderson)
• TeaVM: transpiler of Java bytecode, to emit JavaScript and WebAssembly
(Java, Kotlin, Scala) (Alexey Andreev)
• Ocamlrun: OCaml bytecode interpreter for WebAssembly (Sebastian
Markbåge)
71. USAGE SCENARIOS IN WEB
• Write faster version of the specific application
• Using existing C libraries in browser
• Reuse algorithm from service side
• Distribute whole application as wasm
• Not only WEB: nodejs native modules with WASM+FFI
79. SUMMARY
• WebAssembly is an emerging technology
• Very promising and supported by all main browsers
• Shortage of tools, libs, resources
• Most WebAssembly features are part of the future specs