What is it?
WebAssembly is a low-level assembly-like programming language designed to serve as a compilation target for higher-level languages like Rust, Python, C, C#, Swift, Go, and more.
Why is it useful?
From that description alone, there are a few obvious reasons why WebAssembly might be useful:
- Code sharing: libraries that we develop for the server, or for native desktop applications, can now be used directly in the browser-based web applications.
Improved code sharing has the potential to make it easier to build cross-platform applications, while improved performance has the potential to enable the development of applications that otherwise couldn’t have existed on the web at all (like a browser-native Google Earth).
WebAssembly could have implications well beyond the browser. At the end of the day, WebAssembly is a programming language, whose code you execute on a “runtime”. Browsers know how to execute WebAssembly code, but you can run WebAssembly code on other “runtimes” too.
This is referred to as “portability”: the ability to compile code down to WebAssembly possibly spanning multiple different languages), thereby enabling it to run ~anywhere.
Imagine: you spin up a server, and want to run some Python code on it, plus some C# code, plus some other stuff. One way to do that is to install Python, install C#, and so on. But an alternative would be to install a WebAssembly runtime, compile your programs to WebAssembly, and run the WebAssembly code instead. Suddenly, you have a single runtime capable of executing code written in any programming language. (WebAssembly is also heavily sandboxed and designed with a focus on security, which makes it useful for running arbitrary and potentially-untrusted code.)
Why does it matter?
- WebAssembly could enable entirely new classes of applications to run in the browser.
- WebAssembly could usher in a new era for cross-platform development, making it easier to build native and web applications in concert.
- WebAssembly could make it easier to write code that runs anywhere (WASI — which is a standard, and not a tool or technology — is another thing to watch here).
The other thing to think about here is that if WebAssembly is to play an important role in building applications, that would likely have knock-on effects with regards to the developer tools we use to build with WebAssembly. For example, if we’re building Python-based applications in the browser, how do we handle packaging?
What tools / companies have emerged around WebAssembly?
In no particular order, here are a few:
- Wasmer: A WebAssembly runtime
- WAPM: A package manager for WebAssembly
- Pyodide: A Python distribution for the browser, based on WebAssembly
- Fermyon: WebAssembly microservices platform
- Lunatic: Erlang-inspired WebAssembly runtime
How WebAssembly Gets Used: The 18 Most Exciting Startups Building with Wasm - Amplify
As with any emerging technology, half of the early battle is figuring out how and why to use a technology. I'm hoping this post gives developers more insight into how Wasm is being used day to day and helps them make technical choices down the road.
The rise of WebAssembly
In just four short years, WebAssembly has broken free of its origins as a useful browser-based technology and now powers some of the world's most complex distributed applications, from streaming platforms like Disney+ to e-commerce powerhouse Shopify. WebAssembly, or WASM for short, was developed by the World Wide Web Consortium (W3C) and first published in 2018.
Pay attention to WebAssembly
WebAssembly is at an inflection point. Over the next few years, I expect to see increased adoption of WebAssembly across the tech sphere, from containerization to plugin systems to serverless computing platforms. The following is a discussion of what WebAssembly is, what makes it a relevant technology, and where it's being used today.
A cartoon intro to WebAssembly - Mozilla Hacks - the Web developer blog
How WebAssembly changes software distribution | Max Desiatov
Thanks to the open nature of the whole stack WebAssembly is arguably much closer to "write once, run anywhere" than Java/JVM ever was.
Spin - WebAssembly Framework | Hacker News
Someone mentioned about carbon footprint of increase due to containerization and the kubernetes culture during discussion about dagger . Cloud cost, cloud waste and climate impact of current cloud computing setups are some biggest problem of this decade that are often ignored. I think webassembly and frameworks like these are the answer to that problem.
The Scale to Zero Problem
Cloud is expensive. One reason for this is that a typical application instance sits idly waiting for inbound requests. Yet even though it is idle, it is incurring cloud charges. What if there was a way to scale down your application when it was not being used?
Published on August 21, 2022.