WASM Technology survey
This wiki contains may links to WebAssembly related resources that were encountered over time. And the wiki is updated as new resources are found. It is NOT meant to give an exhaustive overview of the field and its current status, but just serves to inspire on some of the ways that Wasm is used in-the-wild.
Open standards: WASM, WASI, Component Model
- WebAssembly 1.0 is supported in all major browsers.
- WebAssembly Core 2.0 is undergoing a W3C recommendation process.
- WebAssembly System Interface is a modular set of specs that bring WASM to the server.
- WebAssembly Component Model provides building blocks that WASI is built on top of.
- Bytecode Alliance promotes adoption, has production-ready implementations (in Rust).
- Cloud Native Computing Foundation (part of Linux Foundation) tracks, creates WASM projects.
Background reading:
- Clound Native Computing Foundation: WASM Developer Survey (Oct 24, 2022)
- Developer Tooling for Cloud-Native Wasm Is Going Mainstream (Nov 04, 2022)
- Evolution of Wasm Standards: Building the Component Model for Wasm (Mar 8, 2023)
- The Four Domains of WASM (Mar 14, 2023)
- The Road Ahead: Insights from Wasm I/O on the Future of Web Assembly (Apr 19, 2023)
- WebAssembly: a new development paradigm for the web @ Google I/O (May 10, 2023)
- Bytecode Alliance: WebAssembly Updated Roadmap for Developers (July 24, 2023)
- The State of WeAssembly Survey 2023 (Oct 18, 2023)
- WIT Cheat Sheet by Cosmonic (Oct 10, 2023)
The introduction of WASM to the server, the cloud, and the edge is more far-reaching than initially apparent. It opens a completely new paradigm to Component-based architecture.
- Fine-grained plugin model. Modularity. Nano processes. Polyglot.
- New software delivery model. Beyond containers.
- Security-first design. Trustless computing. Capability-based security.
- Performant, size/memory efficient, suitable from micro scale and upwards.
- Focus on Developer Experience, ease of use. Minimize stack/infra maintenance.
- Interoperability, portability. Based on open standards (e.g. Component Model).
Terminology popularized by use cases & projects based on this approach (need not be WASM-related):
-
FaaS (Function as a Service)
- E.g. Wasmer, FaaS in Go with WASM, WASI and Rust (HN).
-
Edge Serverless
- E.g. WasmEdge (âfunctions anywhereâ).
- Universal FFI (Foreign Function Interface)
What say the experts?
In a recent publications (Google Doc turned PDF below), Ian âHixieâ Hickson, editor of the HTML specification for 10 years, in January 2023 criticises the use of hypermedia for intricate web applications, and proposes an alternate approach based on Wasm (defending it on Hacker News), among others:
By providing low-level primitives instead, applications could ship with their own implementations of high-level concepts like layout, widgets, and gestures, enabling a much richer set of interactions and custom experiences with much less effort on the part of the developer.
As it happens, among the many high-level primitives, a few low-level APIs have been created and are available on the web today:
- WebAssembly (also known as Wasm) provides a portable compilation target for programming languages beyond JavaScript; it is being actively extended with features such as WasmGC.
- WebGPU provides an API (to JavaScript) that exposes a modern computation and rendering pipeline.
- ARIA (Accessible Rich Internet Applications) provides an ontology for enabling accessibility of arbitrary content.
- WebHID provides an API (to JavaScript) that exposes the underlying input devices on the device.
This document proposes to enable browsers to render web pages that are served not as HTML files, but as Wasm files, skipping the need for HTML, JS, and CSS parsing in the rendering of the page, by having the WebGPU, ARIA, and WebHID APIs exposed directly to Wasm.
Ian-Hickson_Towards-a-modern-Web-stack_2023.pdf (99.5 KB)
(Tooted on the Fediverse in this post)
Solidground specific observations
[Paradigm] Control the Supply Chain
âWebAssembly Everywhereâ represents a paradigm shift which allows fine-grained composition of services, that aligns perfectly to the idea of App-Free Computing. Control of the supply line, dependency management, new ways of packaging and deployment of solutions and a primary focus on Developer/DevOps Experience to bring productivity gains, represents a powerful value proposition.
Thereâs a lot of attention for compliance and open standards, probably driven by the urgent Need and focus on Supply Chain control. An area where Free Software is firmly in the rear guard, which represents a big threat. Prosperity Guilds is exploring the service Software Supply Chain where Solidground can add value.
Wrt packaging and deployment, the IT practices have gone crazy complex in recent years. The paradigm shift intends to address this low-hanging fruit of productivity gains. WebAssembly allows more fine-grained deployment (terminology found: âmicro-microservicesâ, ânanoservicesâ). Docker is recognizing this:
- Docker has Wasm beta support. See: Announcing Docker+Wasm Technical Preview 2 (Mar 22, 2023).
Regarding software delivery model consider this diagram:
In the diagram, where Cosmonic position themself is where the general WASM-based delivery model is (but without the Actor Model, which is added value offered by wasmCloud and Cosmonic).
Component registries
Related to Supply Chain above, but also Groundwork plugins and App-Free Computing needsâŚ
warg
is an in-development open source registry protocol for Wasm packages (components or âworldâ interfaces).warg
provides an index allowing everyone to refer to federated namespaces of Wasm packages without being opinionated about how package content is stored and hosted. Warg is:
- Component Model oriented.
- Federated & highly interoperable.
- Content storage & delivery agnostic.
- Advancing supply-chain security.
This protocol is still under development.
[Paradigm] Small is Huge
Going from a philosophy that âSmall is Hugeâ â Everything works better when it is still small, and complexity comes with size. Solidgrounds wants to adhere to Small Technology principles.
Though thereâs a lot of âcloud-nativeâ and âserverlessâ terminology, the âWasm Everywhereâ paradigm facilitates any scale and any edge devices. Whether services run on a microcontroller IoT devices, mobile phone, web browser, VPS or large cloud clusters⌠it is all supported.
Opportunity: A niche exists for FOSS ecosystems that focus on âsmallnessâ in their offerings.
What all the current vendors and tech companies exploring Wasm have in common is their love for âhigh scalabilityâ. This is a flaw and a weakness that we in Free Software movement can benefit from. Our scale comes from Decentralization.
Opportunity: Polyglot being intrinsic to âWasm Everywhereâ fits fragmented grassroots efforts.
@Ryuno-Ki mentioned the importance for guild members to have enough alignment in technology use, in order offer most value in services exchange. WebAssembly can be the common glue technology, allowing any member to use their own preferred techstack.
- SQLite gets official Wasm support with help from VMWareâs WasmLabs (see: HN discussion).
[Concept] Capability-based programming
WASI has a Capability-based security model. It is a bit confusing how this relates to wasmCloud / Cosmonic projects. This HN comment asks a question, answered by OCaps expert.
In wasmCloud the cryptography is handled by the tooling. For Capabilities you need Claims that are packaged as a JWT. You define the namespaced capabilities yourself, and they become part of the wasmcloud.yaml
of your actor app. You have fine control of what it means when a capability is present, as the capability is defined by its interface (contract based programming). If you expose a key value store
to your app, in production that can mean any KV store implementation is invoked, shielded behind the interface.
-
Spritely Goblins will move to Wasm after their Guile to Wasm runtime is ready.
-
Brooklyn Zelenka, CTO/co-founder of Fission Codes gave an exciting Strangeloop presentation âIPVM: Seamless Services for an Open Worldâ (slides) how by the use of Wasm and UCAN ocaps we can get to distributed compute (App Free Computing). (Should beware blockchain influences with Fission).
[Concept] Visual component composition
WebAssembly Components are a proposed extension on Wasm, that allows Wasm Modules to be encapsulated, and become composable and adaptable. The interface, imports/exports and execution environment can be described as âWITâ Worlds, allow Interface-based Programming (Contract-based programming).
Fastly.com presented at the Cloud Native Wasm Day Europe 2023 a demo featuring a visual drawing canvas, allowing WASM components to be inserted e.g. from a component registry (a federated, distributed namespace of Wasm components), connected together with lines to satisfy import and then exported as a .wasm
file that constitutes the composition.
The wasmbuilder.app demo is online, and Apache 2.0 project on Github in Rust + Typescript.
[Vendor] Cosmonic WebAssembly PaaS
âFrom a simple idea to running your apps anywhere, at scale, in minutes, Cosmonic is the lightweight, low-boilerplate platform that radically simplifies the development lifecycle.â
- âFrom Sketch to Scaleâ
- âAny Cloud, Any Edge, At Any Scaleâ
- âUntangle Dev and Opsâ
Cosmonic is a leading early adopter vendor (chairing Cloud Native Foundation). Co-maintainers of wasmCloud, which they brought into the Cloud Native Foundation, and improving compliance for. Their Paas is based on wasmCloud, but they also have several independent OSS projects. Their philosophy is to be (permissive) open-source.
Key aspect in wasmCloud (which has both a Rust and Elixir impl) and Cosmonic is to âseparate business logic from non-functional requirements (NFRâs)â ⌠which nears same objective of Clean Architecture patternâs infra layer, where Ports & Adapters are âCapabilityâ abstractions.
Note: Vendor Deis Labs works on Spiderlightning CLI to support common Capabilities, defined as WIT and tested against implementations.
wasmCloud uses a bunch of standards: Open Container Initiative (OCI), Open Application Model, Cloud Events, NATS networking and Open Telemetry.
Note: Cosmonic is also offering visual modeling in their tooling:
https://cosmonic.com/assets/medias/untangledevops-985a88a25c08ffa08e89f4ac185de047.mp4
[Project] Cosmonic Concordance: Actor-based CQRS/ES
Recently Cosmonic created Apache-licensed Concordance project in Rust, based on wasmCloud. It is opinionated in that the core of the CQRS/ES model is entirely side-effect free. From the README:
Concordance allows you to reason about your application using the fundamental building blocks of event sourcing:
- Aggregates - WebAssembly components that derive state from an event stream, validate incoming commands, and emit events in response to those commands.
- Projectors - WebAssembly components that project read-optimized data (aka materialized views) based on streams of incoming events
- Process Managers - Known as sagas in other paradigms, a process manager is the inverse of an aggregate: it processes inbound events and starts, advances, and stops processes by emitting the corresponding commands.
- Stateless Event Handlers - used for entities such as notifiers and gateways, you can build WebAssembly components that receive events on a stream and then execute whatever you choose for your business logic.
âConstraints liberate, liberties constrainâ - Runar Bjarnason
This quote is a foundational principle behind this event sourcing library. Youâll find that aggregates are unable to do anything other than return a list of events. They are unable to produce side-effects, which is a good thingâ˘. Likewise, process managers cannot produce side-effects, they can only return a list of commands. Side-effects are explicitly forced into the perview of notifiers (stateless event handlers).
Concordance looks to be independent of the Cosmonic PaaS, but this product is also based on event sourcing internally.
Project is under heavy development. The Bankaccount example app for instance is stand-alone (had Concordance classes embedded). Article on how WIT Worlds can shield from framework impl:
- For the Wit! My First Day with Components (Apr 27, 2023)
[Concept] Cloud Development Environment (CDE)
Bye bye, forge and git⌠CDEâs are on the rise and offer one-stop-shop developer experiences from the browser. This is going to be a big paradigm shift. Vendors all around are jumping on the fact that software development wrt configuring, deploying, maintaining the infra and cloud have become crazy complex.
WebAssembly-Everywhere offers a path to solving the infra and tooling complexity.
- See: StackBlitz Instant Dev Environments. Uses WebContainers based on Wasm.
- See: Introducing StackBlitz Codeflow (video, 30 min.)
(FOSS is lagging behind. One-stop-shop platforms poses a threat to Free Software if it doesnât catch up. The #forgers-guild aims to go beyond âforge federationâ to âforging free softwareâ, decentralized and scoped to Social Coding FSDL, and bring unique strengths of Free Software movement into play.)
[Fediverse] DDD, AS/AP, Solid, DID/VC (OMG )
Quite unexpected finding of Naamio app for the Fediverse, based on Wasm, and developed by (mysterious) cooperative Omnify Foundation. Uses ActivityPub, DIDs, Solid, and Verifiable Credentials.
- Source: Wasm I/O 2023 by P J Laszkowicz âFrom Event-Driven to Automotiveâ (video, slides).
Note: Uses combination of Wasm (fine-grained composition) and gRPC (system orchestration).
[Concept] Universal plugin models
The BSD3-Clause project Extism: The Universal Plugin System right now offers integrations for 15 languages and the web browser. Their goal is to make all software programmable, and their plugin system lends sandboxed polyglot support for that. Integration requires a Host SDK and then Plugin Development Kits (PDKâs) in your language to quickly write plugin code.
Example: Elixir Game Server + Extism plugin integration.
Elixirâs actor model handles real-time user interactions playing in a âgame arenaâ via PubSub in Phoenix LiveView, while the games can be written in any language thatâs supported by Extism.
- See: Elixir GameServer with Extism (GameBox live demo at Wasm I/O), GameBox live.
- See also: Suborbital Make your SaaS application extensible for developers. (different take)
- See also: The Hashicorp go-plugin ported to Wasm: go-plugin project.
- Plugins in Wasm (polyglot, size-efficient, memory-safe, sandboxed and portable).
- Plugin communication to host compatible with Hashicorp (gRPC-based + Protocol buffers).
- See also: Zellij terminal workspace with Wasm/WASI-based plugin system in Rust.
- (OT related: Elevate Your Plugin Development with Hook-Driven-Development)
[Concept] Erlang/OTP concurrency on Rust
Lunatic Solutions offers a wasm-based Erlang/OTP-like actor model implementation in native Rust.
Lunatic combines the fault-tolerance and massive concurrency of Erlang with the capability-based security of WebAssembly, it creates a powerful programming model.
Lunatic is a single executable and runs on Windows, macOS and Linux. It spawns lightweight processes from WebAssembly modules that have their own heap/stack. These processes are preemptively scheduled on a multi-threaded executor.
[Concept] Rust-based Web UI
Great comparison of emerging Rust-based GUI approaches (see also: HN Discussion, 268 comments)
Leptos: Build Fast Web applications with Rust is a reactive web framework most similar to SolidJS and Sycamore (Rust) and with inspirations from other popular libs. See the Online Book (In progress).
Looks properly usable. Following demo shows some development with TailwindCSS in Rust:
While Leptos has the more modern approach to Web Design, thereâs a more popular web framework in Rust that supports WebAssembly, which is:
- Yew: A framework for creating reliable and efficient web applications.
Yew is set up more as a React-like framework that is diffing the DOM.
[Innovation] Makepad Modern GUIâs in Rust
Though related to the UI topic above this one, Makepad deserves a place of its own. A seriously impressive work in Rust where complex GUIâs are defined by a Figma-like DSL with background code support. It is an effort to bring Coders and Designers closer together. Wasm/WebGL is one of their compilation targets.
This hints at a paradigm beyond the browser straitjacket, moving away from Web 2.0!
Seriously consider watching this video, where the slides are done with Makepad and run real-time multiple applications within it at 120 fpsâŚ
One very cool aspect re:Floorplanner is that with Makepad both the IDE and the GUI design can travel within the app itself and be live-coded and changed. Downside: No a11y support (I filed an issue).
[Bounded context] Diagramming
I found one Yew project (no longer maintained), called yew-flow (see demo), which was an attempt to port React Flow - best candidate for integration in Floorplanner thus far - and offer that as a Wasm module.
This may not be the best approach⌠I am thinking more in the line of: Code that wraps any NPM project into a Wasm module or - better - component. A WIT-based component interface would be exposed and allow for different diagram type defitions to be fed to the component, and domain-specific diagram output to be fed back.
[Innovation] Freenet Rebooting
(Update: Freenet.org is not really a reboot, rather a hostile fork by the founder against the community)
Freenet.org started in 1999 and was quite popular for a time and still going today (Wikipedia). In 2023 the community started a new project called Locutus in Rust (Matrix chatroom):
Freenet 2023, also known as Locutus, is a fully decentralized, peer-to-peer network and a drop-in replacement for the world wide web. It operates as a global shared computer, providing a platform for sophisticated decentralized software systems. Locutus allows developers to create decentralized alternatives to centralized services, including messaging, social media, email, and e-commerce. Itâs designed for simplicity and flexibility and can be used seamlessly through your web browser. The platformâs user-friendly decentralized applications are scalable, interoperable, and secured with cryptography.
Locutus is a decentralized key-value database. It uses the same small world routing algorithm as the original Freenet design, but each key is a cryptographic contract implemented in Web Assembly, and the value associated with each contract is called its state. The role of the cryptographic contract is to specify what state is allowed for this contract, and how the state is modified.
Freenet (or similar concept) might have a role in Prosperity Guilds as a backbone (just an idea).
[Showcase] Wordpress Playground
Automattic launched an official Wordpress Playground that runs a full Wordpress server entirely in the browser based on WebAssembly. Discussed on HN in this submission.
The operating system of the web â on your device
Web browsers are just the beginning â WordPress Playground works in Node.js, mobile apps, VS Code, and more. Whether you want to build a note-taking application for mobile devices, an automated testing environment, or demo a live WooCommerce store on your site â Playground will support you.
How is this possible? Playground uses the latest, cutting-edge technologies to make the key WordPress dependencies work in JavaScript.
- PHP runs as a WebAssembly binary
- MySQL is replaced for SQLite via a WordPress plugin
- Web server is implemented in JavaScript as a Service Worker
[Project] VectorVisor in Rust
VectorVisor is a vectorizing binary translator for GPUs, designed to make it easy to run many copies of a single-threaded WebAssembly program in parallel using GPUs.
"GPU programming models offer a level of abstraction that is either too low-level (e.g., OpenCL, CUDA) or too high-level (e.g., TensorFlow, Halide), depending on the language. Not all applications fit into either category, resulting in lost opportunities for GPU acceleration.
VectorVisor is a vectorized binary translator which remedies this issue by taking in existing single-threaded WebAssembly programs and running many copies of them using a GPU."
[Product] Nginx Unit Universal Web App Server
NGINX Unit is a lightweight and versatile application runtime that provides the essential components for your web application as a single open-source server: running application code (including WebAssembly), serving static assets, handling TLS and request routing.
Among key features is WebAssembly support that allows running any Wasm modules/components on the server.
[Product] Ambient Game Engine
Game engine built with Rust, WebAssembly and WebGPU. Our WASM use is innovative; it is being used as both a sandboxed runtime for user code, and as a way to run the entire Ambient runtime in the browser. This, paired with our ECS data model, enables a highly modular architecture that allows other developers to make isolated packages (code, 3D models, tools, etc.) that they can add as a mod to your game.
The use of wasm in combination with the Entity Component System may be very flexible in App Free Computing component-oriented social experiences (e.g. modular UX/UI).
- See also HN discussion and Platform blog + video presentation.
- Bevy is another data-driven game engine in Rust, also ECS-based with Wasm support. @enhance_dev is on the Fediverse.
[Product] Enhance WASM: Vendor-neutral server-side rendering Web Components
Enhance WASM is bringing server side rendered web components to everyone. Author your components in friendly, standards based syntax. Reuse them across multiple languages, frameworks, and servers. Upgrade them using familiar client side code when needed.
Read: Introducing Enhance WASM. The idea to package SSR-rendered WebComponents into WebAssembly modules is appealing.
[Project] FluentCI Engine: Programmable CI/CD engine without Containers
FluentCI Engine is a programmable CI/CD engine that is designed to be simple, flexible, and easy to use. It is supposed to run on the host machine without containerization or virtualization, and it is designed to be used with Nix, Pkgx, Devbox, Flox, Devenv, EnvHub, Pixi and Mise.
MPL-2.0 licensed. Implemented in Rust/Typescript and using WebAssembly-based plugin system, based on Extism.
Features
- Simple and easy to use
- Flexible
- No containerization or virtualization
- Built-in support for Nix, Pkgx, Devbox, Flox, Devenv, Envhub, Mise and Pixi
- Cache support (backends: local, S3, GCS, R2)
- SDK for writing pipelines in TypeScript, see @fluentci/sdk
- GraphQL API, see API Documentation
- OpenTelemetry tracing
- Plugin system in WebAssembly, see examples
[Project] Wikimedia Wikifunctions
Wikifunctions is a Wikimedia project for everyone to collaboratively create and maintain a library of code functions to support the Wikimedia projects and beyond, in the worldâs natural and programming languages.
Via announcement on Mastodon their newsletter reads:
Wikifunctions:Status updates/2024-11-01: The immediate work surrounds how we might better interact with WebAssembly (WASM). Almost precisely one year ago, we announced that we would begin running Python and JS code in WASM for its sandboxing characteristics. Since then, we have been interacting with WASM via the WebAssembly System Interface (WASI), which allows WASM commands selective access to the underlying operating system.
Now they rewrite their backend to Rust to benefit from the excellent wasm tooling, which they missed for their languages JS/Node and Python at this time (1 Sept 2024).