Slide 1

Slide 1 text

WebAssembly Past, Present, Future Christian Weyer Thinktecture AG Martina Kraus Kraus Consulting IT Thorsten Hans Thinktecture AG

Slide 2

Slide 2 text

WebAssembly Past, Present, Future Intro 2

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

WebAssembly Past, Present, Future Past Martina Kraus 5

Slide 6

Slide 6 text

§ 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

Slide 7

Slide 7 text

§ 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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

§ 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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

WebAssembly Past, Present, Future Present Thorsten Hans 13

Slide 14

Slide 14 text

§ 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

Slide 15

Slide 15 text

§ 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

Slide 16

Slide 16 text

§ 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

Slide 17

Slide 17 text

§ 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

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

WebAssembly Past, Present, Future Future Christian Weyer 19

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

§ 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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

§ 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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

WebAssembly Past, Present, Future Wrap-Up 27

Slide 28

Slide 28 text

§ 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

Slide 29

Slide 29 text

WebAssembly Past, Present, Future Thank you! 29

Slide 30

Slide 30 text

WebAssembly Past, Present, Future Links 30

Slide 31

Slide 31 text

§ 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