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

WebAssembly: Past, Present, Future

WebAssembly: Past, Present, Future

Ein interessanter Name, der momentan viel durch die Software-Entwicklungs-Medien geistert: WebAssembly (Wasm). Doch es ist weder (nur) Web, noch ist es (klassisches) Assembly. In dieser Keynote zeigen Martina Kraus, Thorsten Hans und Christian Weyer, was Wasm wirklich ist und welches Potenzial es auch - und vor allem - jenseits des Browsers hat. Dabei beleuchten sie die noch junge Vergangenheit von Wasm, blicken auf den aktuellen Stand der Spezifikationen und Technologien und malen ein Bild, wie Wasm künftig signifikanten Anteil in einer allgegenwärtigen Computing-Welt haben kann. Gemeinsam mit den drei entdecken Sie, dass WebAssembly schon längst nicht mehr nur für das Web ist.

Christian Weyer

February 21, 2023
Tweet

More Decks by Christian Weyer

Other Decks in Programming

Transcript

  1. WebAssembly (Wasm) is a § secure § fast § portable

    stack-based execution environment (virtual machine) used for running applications. WebAssembly Past, Present, Future What is WebAssembly? 3 Intro
  2. Server Server WebAssembly Past, Present, Future Platforms: Past, present, future

    4 Past Present Future Web Web Web Cloud Cloud Microcontroller Extensibility Extensibility Bare metal Edge Intro
  3. § The browser evolved to a smart client application platform

    § Browser APIs (File System Access, Clipboard API..) § Runs on almost every platform § Handling updates is much more easier (and very cheap) § A new version will be downloaded from the server WebAssembly Past, Present, Future Why should I care about the web? 6 Past | Present | Future
  4. § Fast, efficient, and portable § Low-level bytecode for the

    web § Uses existing browser sandbox features § Use native code to run inside the browser, in a secure environment § No plugins needed § Standards and specifications through W3C WebAssembly Past, Present, Future Why WebAssembly in the browser? 7 Past | Present | Future
  5. “WebAssembly is designed to complement JavaScript, not replace it” WebAssembly

    Past, Present, Future WebAssembly in the browser 8 Past | Present | Future
  6. 1. Migrate your native desktop app to the web 2.

    Speed up your web application WebAssembly Past, Present, Future Scenarios for WebAssembly in the browser 9 Past | Present | Future
  7. § Video editing § 3D rendering § Video games §

    Music streaming § Encryption § Image recognition/ processing § Running simulations WebAssembly Past, Present, Future Good for performance-intensive use cases 11 Past | Present | Future
  8. § Resource utilization § With same compute power, more applications

    could be executed § Speed § Wasm modules are bootstrapped in no-time and fast at runtime § Security § Wasm modules are isolated and every module has dedicated permissions § Size § Compared to other distributables (containers | VMs), Wasm is super small WebAssembly Past, Present, Future Why WebAssembly on the server? 14 Past | Present | Future
  9. § WASI (WebAssembly System Interface) provides system calls to Wasm

    programs § WASI is platform-agnostic: run Wasm applications on any WASI- compliant platform § WASI is designed to provide only essential system calls that Wasm applications needs to run (again contributes to speed) WebAssembly Past, Present, Future WASI 15 Past | Present | Future
  10. § Provide necessary infrastructure for executing Wasm applications leveraging APIs

    specified and provided by WASI § Handle system calls made by Wasm modules and delegates them to the underlying platform, e.g.: § File access § Network access § Environment variables § Notable WASI runtimes § wasmtime § wasmer § WebAssembly Micro Runtime (WAMR) WebAssembly Past, Present, Future WASI runtimes 16 Past | Present | Future
  11. § No infrastructure management § Speed of Wasm allows scale-down

    to 0 (ZERO) § No impact on request performance § Notable Serverless Wasm platforms today § Fermyon § Fermyon Cloud § Spin § Microsoft is experimenting in Azure § (currently in AKS - and yes, that’s not serverless, yet 😁) WebAssembly Past, Present, Future Serverless Wasm 17 Past | Present | Future
  12. CRUD HTTP API with Rust – Fermyon Spin WebAssembly Past,

    Present, Future DEMO 18 Past | Present | Future
  13. 1. Extensibility as a powerful use case 2. .NET as

    a player in the Wasm world WebAssembly Past, Present, Future What’s next for WebAssembly & for us? 20 Past | Present | Future
  14. § Plugins for everyone, by everyone, everywhere § Leverage secure

    Wasm sandbox § Write plugins in any code § Use plugins in any code § E.g. Extism § Plugins written in any language § Hosts written in any language § Common application interfaces § Provide value-add services & features without need for dedicated language / platform SDKs § E.g. SpiderLightning § Abstract away distributed application capabilities, such as state management, pub/sub, event driven programming WebAssembly Past, Present, Future Secure extensibility 21 Past | Present | Future
  15. § .NET’s current Wasm support builds on Mono § .NET-compiled

    Wasm & JS interop (since .NET 7.0) § Take your C# / .NET code into the browser and integrate it with any JS code running in the browser, e.g. JS SPAs § Blazor WebAssembly (since .NET Core 3.1) § Build C#- / .NET-based SPAs with Razor components § Compiles to .NET assemblies § Executes on a .NET runtime compiled to Wasm § AOT mode enables ahead-of-time compilation WebAssembly Past, Present, Future .NET & Wasm - browser 23 Past | Present | Future
  16. § .NET originally has not been made for Wasm &

    WASI § Especially regarding size, runtime, garbage collection § .NET WASI SDK § Experimental for now § Currently evolved & stabilized towards .NET 8 release § .NET NativeAOT-LLVM § NativeAOT can make .NET binaries smaller & faster § Future Wasm support will be based on NativeAOT, in addition to Mono § Very experimental today WebAssembly Past, Present, Future .NET & Wasm – beyond the browser 24 Past | Present | Future
  17. § Dreaming of an Azure Functions successor – Wasm-/WASI-based §

    Today: Third party Spin .NET SDK § Experimental for now (of course!) WebAssembly Past, Present, Future .NET & Wasm – serverless 25 Past | Present | Future
  18. .NET WASI SDK Sneak peak of future NativeAOT Wasm support

    WebAssembly Past, Present, Future DEMO 26 Past | Present | Future
  19. § Secure “write once, run anywhere” may come true §

    A lot of things are still moving, though § Specifications & standards § Technologies § Developer tooling § Make yourself familiar with WebAssembly’s possibilities today! WebAssembly Past, Present, Future WebAssembly is and will be a big thing 🙌 28 Wrap-Up Server Future Web Cloud Microcontroller Extensibility Bare metal Edge
  20. § WASI § https://wasi.dev/ § Fermyon Spin § https://www.fermyon.com/spin §

    .NET WASI SDK § https://github.com/dotnet/dotnet-wasi-sdk § Extism § https://github.com/extism/extism § SpiderLightning § https://github.com/deislabs/spiderlightning § Spec, Standards § https://github.com/WebAssembly/proposals § https://webassembly.org/roadmap/ § https://github.com/WebAssembly/WASI/blob/main/Proposals.md WebAssembly Past, Present, Future Links 31