WebAssembly on the server-side

Michael Yuan
Nov 23, 2019 · 4 min read

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.

Image for post
Image for post

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 for post
Image for post

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!

Image for post
Image for post

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

Image for post
Image for post

Wasm

Dedicated to curating the highest quality WebAssembly…

Michael Yuan

Written by

Startup founder. Venture investor. Principal Investigator at NIH funded research projects. PhD in astrophysics. Author of 5 books and many papers.

Wasm

Wasm

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.

Michael Yuan

Written by

Startup founder. Venture investor. Principal Investigator at NIH funded research projects. PhD in astrophysics. Author of 5 books and many papers.

Wasm

Wasm

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.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

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