This tool helps apps work wherever

WebAssembly was intended for browsers, although it's increasingly used in the cloud.

January 15, 2022
This tool helps apps work wherever

Programmers can't just write code to build a new app. Most software, including database management systems, needs additional software to operate. Just because an app works on your laptop doesn't imply it will on your company's data center, which may lack needed software.

Investors have put hundreds of millions of dollars into firms like HashiCorp and GitLab that ease data center application preparation. Docker popularized "containers," a technique that bundles cloud-based applications.

Docker cofounder Solomon Hykes thinks his company's technology will soon be superseded by WebAssembly, or "WASM." WASM is quicker and more secure than standard containers, says Hykes. Hykes tweeted in March that he and his team "wouldn't have needed" to build Docker if WASM existed in 2008. "It's crucial."

Hykes, who resigned as Docker's CTO last year but remains on the board, isn't impartial. He invests in Wasmer, a WASM startup. He later tweeted that Docker may enable WASM apps. Docker didn't comment.

The new technology isn't only appealing to him. Mozilla and other browser vendors released WASM in 2017 as a new option to construct cross-browser apps. It's also used for non-browser apps. Fastly and Cloudflare allow clients run WASM on their servers.

WASM is new. C, C++, and Mozilla's Rust are supported. Cloudflare only suggests utilizing WASM for restricted, computing-heavy workloads, such as audio processing or picture scaling, not full-blown apps. Syrus Akbary, Wasmer's creator, thinks it will become a worldwide computer platform, fitting Java's 1990s "Write once, run everywhere" slogan.

Java delivered in part. Developers now confront problems beyond ensuring a software functions across numerous hardware architectures and operating systems. One is installing and configuring extra software to make an app operate. Docker and related technologies help. Fastly CTO Tyler McMullen believes prior approaches to make apps portable sacrificed security and speed. WASM doesn't demand concessions, he claims. "Nothing else met our demands," he adds.

WASM's advantages come from its browser roots. Every computer device has a browser. Years have been spent ensuring that web developers can build code that works on any standards-compliant browser, independent of the end user's hardware and operating system. Browser manufacturers have also segregated website code from your device's operating system and other websites.

WASM was created so developers could design browser-based applications in languages other than JavaScript. JavaScript has become a sophisticated language that can develop desktop-like apps like Google Docs, but it has limits. Performance matters.

Programmers use human-readable languages. Before a computer can execute "source code," it must be converted. Your browser downloads JavaScript and transforms it into machine-readable code when you use a web app. This constant translation is why even the fastest online apps are slower than native ones.

Some source code is easier to convert to machine code. "High level" programming languages like JavaScript let programmers provide fewer detailed computer instructions. Imagine telling someone to "create a peanut butter and jelly sandwich" without having to explain where to get the ingredients, how to open the refrigerator door, or how to spread the peanut butter. This makes it simpler and quicker for programmers to create code, but the browser must then convert high-level commands into machine-specific instructions.

WASM enables programmers write in a "high level" language and then convert it into "bytecode" The translation into WASM bytecode occurs before you visit a site, so your computer has less work once you download the code.

WASM is analogous to the Java platform, which lets developers create code in Java or a few other languages and transform it into bytecode that can run on numerous systems. McMullen believes WASM uses less resources than Java. Because Mozilla isolates WASM code from the device it runs on, programs are less likely to meddle. McMullen argues WASM might make multi-user apps safer by isolating users.

Mozilla's Lin Clark believes WASM might have further security advantages.

Open source "modules" offer typical functions like password authentication. These components save programmers from reinventing the wheel. Developers must trust more outsiders. The new owner of a Node data processing module last year exploited it to propagate malware.

Clark believes WASM may segregate modules from each other and the underlying code platform. Different WASM systems might enable developers establish rights for each piece of code, like smartphone applications.