News

Blazor Among Top Libraries for 'Niche' WebAssembly, Which Sees Shrinking Usage

While WebAssembly has made quite a splash in the web-dev world, a new report describes it as "niche" tech whose usage is actually contracting, though among that shrinking usage, Microsoft's Blazor is among the top libraries.

"Clearly WebAssembly isn't widely used, and rather than seeing a growth in usage, we are seeing a modest contraction," Colin Eberhardt said in a post this week on the Web Almanac site by HTTP Archive.

WebAssembly (or Wasm), as web developers in the Microsoft ecosystem well know, is an open source project that lets developers use its assembly-like code as a compilation target so programming languages including C# can be used for browser-based apps instead of ubiquitous JavaScript.

Or, as the Sept. 25 post says, "WebAssembly introduces a new runtime into the browser, one which works alongside, and in close collaboration, with the JavaScript runtime. It is relatively lightweight in comparison, with a small instruction set and a strict isolation model (WebAssembly has no I/O by default). One of the primary motivators for developing WebAssembly was to provide a compilation target for a wide range of programming languages (C++, Rust, Go etc.), allowing developers to write new web applications, or port existing applications, with a wider toolset."

Using complicated methodology, the report examines how widely WebAssembly is used, what it's used for, what languages are people using with it and what features are being used.

Of special interest to readers of Visual Studio Magazine is the finding that Blazor is among the top WebAssembly libraries when ranked by percentage of Wasm requests that could be attributed to it. Blazor comes in third (8.5 percent of combined desktop/mobile requests) behind Amazon IVS (34.9 percent) and Hyphenopoly (12.1 percent).

Popular WebAssembly Libraries
[Click on image for larger view.] Popular WebAssembly Libraries (source: Web Almanac).

On another scale, measuring WebAssembly language usage, Blazor is farther down the ranking, coming in at No. 5 (3.5 percent) behind LikelyEmscripten (61.1 percent), Unknown (16.9 percent), Emscripten (11.8 percent) and Rust (6 percent), and only ahead of Go (0.7 percent). Of course, Blazor is a framework, not a language. The language most likely to be used in Blazor WebAssembly projects is C#. Emscripten isn't a language either, though the compiler toolchain is associated with C++.

WebAssembly Language Usage
[Click on image for larger view.] WebAssembly Language Usage (source: Web Almanac).

Remarkably, the above results seem to stand in contrast to The State of WebAssembly 2022 report published in June, which was also written by Eberhardt (though on the site of Scott Logic, where he is CTO), as detailed in the Visual Studio Magazine article, "Blazor Posts Biggest Gain in WebAssembly Usage: Report."

Languages Used Frequently or Sometimes Compared to Last Year
[Click on image for larger view.] Languages Used Frequently or Sometimes Compared to Last Year (source: Scott Logic).
Languages Used Frequently or Sometimes Compared to Last Year
[Click on image for larger view.] Which Languages People Most Want to Use for WebAssembly Development Compared to Last Year (source: Scott Logic).

For 2022, just like Scott Logic's 2021 report, Rust was listed as the No. 1 language used with WebAssembly. "Rust once again comes out on top, with 45 percent saying they use it frequently or sometimes," Eberhardt said in June. "WebAssembly and Rust do have quite a close relationship, most WebAssembly runtimes are written in Rust, as are the various platforms based on wasm. It also enjoys some of the best tooling, so this result doesn't come as a big surprise."

The June report also said, "It's been a good year for Blazor, with a big climb in usage and desire," and, "It's been quite the year for WebAssembly!" Regarding the latter, Eberhardt's June post detailed a climb in usage for serverless computing, containerization and as a plug-in host. It also reported that survey respondents are using WebAssembly much more frequently.

The new Web Almanac report, however, paints a less optimistic picture of the new tech, which only became an officially recognized W3C standard in December 2019.

For example, Eberhardt, in addition to noting that WebAssembly isn't widely used and has actually seen a modest contraction in usage instead of growth, also said, "WebAssembly is undeniably a niche technology when it comes to the web, and there is a very good chance that it always will be. While WebAssembly has brought a wide range of languages to the web -- C++, Rust, Go, AssemblyScript, C# and more -- these cannot yet be used interchangeably with JavaScript. For the vast majority of websites, where the content is relatively static (rendered in HTML with CSS) with a modest amount of interactivity (via JavaScript) there simply isn't a compelling reason to use WebAssembly at the moment."

However, the claim that C# can't be used interchangeably with JavaScript seems to have been upended in recent Microsoft documentation about .NET JavaScript interop on WebAssembly, which says, ".NET 7 introduces a new low-level mechanism for using .NET in JavaScript-based apps," Microsoft explained. "With this new JavaScript interop capability, you can invoke .NET code from JavaScript using the .NET WebAssembly runtime as well [as] call into JavaScript functionality from .NET without any dependency on the Blazor UI component model," as detailed in the Sept. 20 VSM article, "WebAssembly Steals the ASP.NET Core Show in .NET 7 RC1."

Eberhardt's conclusions weren't all negative, though, as he further said, "Despite being a niche technology, WebAssembly is already adding value to the web. There are a number of web applications that benefit greatly from this technology. However, web applications are often not visible to the 'crawl' which forms the basis of this study.

"Finally, the core features of the WebAssembly runtime -- multi-language, lightweight, secure -- are making it a popular choice for a wider range of non-browser applications. The State of WebAssembly 2022 survey saw a significant increase in the number of people using this technology for serverless, containerization and plug-in applications. The future of WebAssembly could be as a niche web technology, but as an entirely mainstream runtime on a wide range of other platforms."

The WebAssembly data is but one part of the sprawling HTTP Archive's annual state of the web report.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube