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
    Past, Present, Future
    Christian Weyer
    Thinktecture AG
    Martina Kraus
    Kraus Consulting IT
    Thorsten Hans
    Thinktecture AG

    View full-size slide

  2. WebAssembly
    Past, Present, Future
    Intro
    2

    View full-size slide

  3. 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

    View full-size slide

  4. 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

    View full-size slide

  5. WebAssembly
    Past, Present, Future
    Past
    Martina Kraus
    5

    View full-size slide

  6. § 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

    View full-size slide

  7. § 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

    View full-size slide

  8. “WebAssembly is designed to
    complement JavaScript,
    not replace it”
    WebAssembly
    Past, Present, Future
    WebAssembly in the browser
    8
    Past | Present | Future

    View full-size slide

  9. 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

    View full-size slide

  10. WebAssembly
    Past, Present, Future
    Migrating your desktop app to the web
    10
    Past | Present | Future

    View full-size slide

  11. § 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

    View full-size slide

  12. Angular SPA with Rust image processing lib
    WebAssembly
    Past, Present, Future
    DEMO
    12
    Past | Present | Future

    View full-size slide

  13. WebAssembly
    Past, Present, Future
    Present
    Thorsten Hans
    13

    View full-size slide

  14. § 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

    View full-size slide

  15. § 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

    View full-size slide

  16. § 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

    View full-size slide

  17. § 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

    View full-size slide

  18. CRUD HTTP API with Rust – Fermyon Spin
    WebAssembly
    Past, Present, Future
    DEMO
    18
    Past | Present | Future

    View full-size slide

  19. WebAssembly
    Past, Present, Future
    Future
    Christian Weyer
    19

    View full-size slide

  20. 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

    View full-size slide

  21. § 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

    View full-size slide

  22. Extensibility with Extism
    WebAssembly
    Past, Present, Future
    DEMO
    22
    Past | Present | Future

    View full-size slide

  23. § .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

    View full-size slide

  24. § .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

    View full-size slide

  25. § 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

    View full-size slide

  26. .NET WASI SDK
    Sneak peak of future NativeAOT Wasm support
    WebAssembly
    Past, Present, Future
    DEMO
    26
    Past | Present | Future

    View full-size slide

  27. WebAssembly
    Past, Present, Future
    Wrap-Up
    27

    View full-size slide

  28. § 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

    View full-size slide

  29. WebAssembly
    Past, Present, Future
    Thank
    you!
    29

    View full-size slide

  30. WebAssembly
    Past, Present, Future
    Links
    30

    View full-size slide

  31. § 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

    View full-size slide