WebAssembly increasingly used for plug-ins and serverless, but needs better tools

WebAssembly increasingly used for plug-ins and serverless, but needs better tools

A new WebAssembly survey sponsored by software development company Scott Logic shows growing usage as a runtime for plug-ins and serverless, alongside web development, and consensus that tooling is lacking.

According to the developer survey, use of WebAssembly outside the browser is increasing. Asked what WebAssembly is used for, serverless was identified by nearly 40 percent and use as a plug-in environment by nearly 30 percent, with both categories growing fast since earlier surveys in 2021 and 2022. Use for web development remains the biggest category, but has declined a little since 2021.

Trends in the use of WebAssembly: no longer just for web applications

Developers prefer to code in Rust, the survey reports, followed by JavaScript, C++, and direct coding of WebAssembly Text Format. Scott Logic CTO Colin Eberhardt notes that the status of JavaScript as the second most popular language is “notable considering that you cannot compile JavaScript to WebAssembly.” WebAssembly was designed to complement JavaScript rather than to be another way to run it. There is a certain logic to it though: If WebAssembly is considered as a kind of universal bytecode that enables applications to run in sandboxed environments and cross-platform, then it is understandable that developers expect to be able to use JavaScript, the world’s most popular programming language according to many surveys, in those environments. This is possible thanks to projects like Javy, which is a WebAssembly-embedded JavaScript runtime.  

The result also show a big difference between end user developers, who target WebAssembly, and those engaged in WebAssembly tooling. As one might expect, the end user developers did not use Rust so heavily (though still preferring it), and had higher usage for AssemblyScript, Zig, C# and Go, compared to the tool developers.

It is also notable that a survey published last month by SlashData, Linux Foundation and CNCF (Cloud Native Computing Foundation), confusingly also called The State of WebAssembly, came up with very different results, with JavaScript top, followed by C#, Python and Java. Rust was in 7th place. Aside from showing the risks of placing too much faith in a single survey, this likely indicates that Scott Logic reached a more niche community, and CNCF a more general one.

On one matter there is consensus between both surveys though. The top challenges in WebAssembly are around tooling, with CNCF respondents complaining that “Debugging and troubleshooting is difficult,” and Scott Logic participants placing “better debugging support” about equal with “better integration with non-browser APIs” as what the ecosystem most needs. Better build tooling is also high on the list.

WebAssembly is maturing though. Top feature requests are threads, component model, garbage collection and exception handling, and of these all but component model are already at implementation or standardisation phase, Eberhardt states, meaning they are “ready to use and close to finalization.” Component model is an early stage proposal.

The big picture though is that WebAssembly is no longer all about web applications, but rather of increasing interest for running code in a variety of different environments. “Many respondents shared that they expect WebAssembly to deliver on the ‘write-once and run anywhere promise’ that was originally made by Java,” Eberhardt notes.