Published in


WebAssembly on the server-side

WebAssembly (Wasm), originally invented and developed by Mozilla, Google, Microsoft, Apple, and others at W3C; is a high-performance execution engine for in-browser web applications. As it gains popularity on the client-side, Wasm is also becoming a serious contender as a server-side technology.

Value propositions

Wasm’s move from client-side to server-side follows well-traveled paths of previous generations of technologies such as Java and JavaScript. Compared with existing solutions, Wasm offers some compelling value propositions on the server-side.

Compared with the JVM and JavaScript engines, Wasm supports 20+ programming languages via the LLVM toolchain, offering developers freedom and productivity. In particular, it supports new programming languages beloved by influential developers, such as Rust. At the same time, Wasm could support native hardware features such as AI-optimized chips and field-programmable gate array (FPGA) hardware circuits. Wasm provides near-native performance without sacrificing safety.

Check out how to run high-performance Rust functions in Node.js web apps. In this setup, the Rust function is compiled to portable WebAssembly bytecode and runs safely in a WebAssembly VM.

Image Credit: https://steveklabnik.github.io/booster2018/

When compared with containers like Docker, Wasm provides a higher level of abstraction, and hence higher productivity, for developers. Wasm can deploy code and applications instantly, instead of launching operating systems.

Wasm consumes much less memory and resources than typical containers. In particular, its security model allows modular access to the underlying hardware and Operating System (OS), on a per-function call basis, ensuring safety while retaining native performance.

If WASM+WASI existed in 2008, we wouldn’t have needed to created Docker. That’s how important it is. WebAssembly on the server is the future of computing. — Solomon Hykes, Co-founder of Docker

Furthermore, the server-side Wasm benefits from significant innovations coming from the blockchain community.

Blockchain leads the way

Server-side Wasm is currently in an early stage. A significant amount of work (optimizations, developer tools, and integration libraries) has to be done before Wasm can see meaningful adoption in enterprise settings. However, developers are already using it for microservices in an emerging field of enterprise computing; decentralized blockchain applications.

Blockchain smart contracts are immutable and automatically executed code. Applications, known as decentralized applications (or dapps), can interact with smart contracts via web interfaces i.e. Remote Procedure Call (RPC) service endpoints. That makes smart contracts natural microservices.

Large public blockchain networks, such as Ethereum, EOS, and Polkadot, have all committed to adopting Wasm as their next-generation execution engines. As a result, the public blockchain, with its decentralized and serverless infrastructure is the best platform to write and deploy Wasm services today.

Moreover, the server-side Wasm can directly leverage billions of dollars worth of R&D investments poured into the blockchain space in recent years. Many of those blockchain R&D innovations are highly relevant to enterprise use cases; even those inside centralized data centers. Some of those use cases include:

  • Metered and billable shared resources usage accurate to opcodes
  • Trustless consensus for computing results
  • Digital currency infrastructure support
  • Formal verification of applications
  • Zero-knowledge computing
  • Improving deterministic behavior of applications

Show me the code

The Second State VM (SSVM) is a WebAssembly runtime that is specifically optimized for server-side applications.

To see some code examples, check out the following tutorials.

On the blockchain, the SSVM is at the forefront of providing Ethereum-flavored WebAssembly (Ewasm) for the next-gen Ethereum-compatible blockchain systems. The SSVM, for blockchain, natively supports 256-bit integer operations. It handles non-deterministic opcodes and gas computation inside the VM, resulting in much-improved performance compared with other leading Ewasm implementations.

The road ahead

The road ahead for Wasm on the server-side is very promising. We look forward to sharing more of our cutting-edge developments as we blaze a trail; evolving toward the next-gen cloud architecture!

If you would like to learn more about anything mentioned in this article, please contact us at SecondState.io





Dedicated to curating the highest quality WebAssembly (Wasm) information, in an unofficial capacity. Encouraging writers, developers and researchers to share everything from innovative business ideas & Wasm use cases, right through to technical insights, documentation & code.

Recommended from Medium

Python File to Executable File In Python

Cloud ERP — Thinking Smarter!

Creating two SSH keys on Mac for two different GitHub accounts

CS373 Fall 2021: Noah Kim

Image encryption and decryption web application using Flask

Superalgos Review — Reviewing the starting tutorials

Setup a GitOps deployment model on your local development environment with k3s/k3d and ArgoCD

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Michael Yuan

Michael Yuan

Technologist and investor

More from Medium

A Micropayments Channel Factory with Solidity

Tweak your Application Performance at DAO layer-

M3O Latest Updates — February 2022

Peer-to-peer store security (syntax)