TNS
VOXPOP
Will JavaScript type annotations kill TypeScript?
The creators of Svelte and Turbo 8 both dropped TS recently saying that "it's not worth it".
Yes: If JavaScript gets type annotations then there's no reason for TypeScript to exist.
0%
No: TypeScript remains the best language for structuring large enterprise applications.
0%
TBD: The existing user base and its corpensource owner means that TypeScript isn’t likely to reach EOL without a putting up a fight.
0%
I hope they both die. I mean, if you really need strong types in the browser then you could leverage WASM and use a real programming language.
0%
I don’t know and I don’t care.
0%
Cloud Native Ecosystem / Containers

What Business Problems Does WebAssembly Solve?

The true test of WebAssembly's (also known as (Wasm) worth is its business use, as companies such as Adobe, Microsoft and Cosmonic, which offers wasmCloud, are bringing Wasm solutions to the market today.
Jun 7th, 2022 8:11am by
Featued image for: What Business Problems Does WebAssembly Solve?
B. Cameron Gain is the founder of ReveCom Media Inc., which has provided consulting services for Cosmonic.

WebAssembly (commonly referred to as Wasm) is certainly a hot topic in the cloud native world. A CNCF survey released during KubeCon+CloudNativeCon EU in May on service mesh expressed how service mesh plug-ins to environments like Wasm were important for 25% of the respondents. There were a number of talks and ample discussion about what wasm is, and more importantly, what it can do, at the recently held KubeCon+CloudNativeCon EU. 

One of the more interesting discussions that attracted some attention was how, due to its design, WebAssembly can replace Docker in many circumstances. But as we’ll see below in this article, over-focusing on that aspect of WebAssembly is missing the point, since what is more important are the business uses that WebAssembly can support as described below. Indeed, like any interesting new programming language or technology in general, the true test of Wasm’s worth is its business use (already, Adobe, Microsoft and Cosmonic, which offers wasmCloud, are bringing Wasm solutions to the market today).

WebAssembly can be used to integrate JavaScript (JS), C++ and Rust in addition to HTML and CSS into a single runtime platform in a binary format that runs directly on a machine level on the CPU. It can be used to support not only Web applications, but can extend to any edge environment and cloud native platform that runs on a CPU, including service mesh and edge Kubernetes support. Wasm has also been around for a while, before the World Wide Web Consortium (W3C) named it as a web standard in 2019, thus becoming the fourth web standard with HTML, CSS and JavaScript. 

Portability and Consistency

One of the main benefits that Wasm offers is its portability and consistency, which can make security and compliance much easier to manage (again, it runs in a binary format on a CPU level). “Logically, WebAssembly gives you a promise that you’ve probably heard before: write once, run anywhere, and you’ve heard that before with maybe Java or SilverLight, or Flash, or one of the previous technologies, but the difference with WebAssembly is that this is community-driven and open,” Liam Randall, CEO and co-founder, Cosmonic, said during a podcast hosted by The New Stack during KubeCon+CloudNativeCon. “It’s already embedded and supported in all of the most modern browser platforms on desktop and mobile devices today. So everybody can start using WebAssembly, which works like a little tiny CPU — you can even put web assembly inside of other applications.”

However, while WebAssembly can offer some nifty benchmarks and offer several efficiencies on a stack level, it is only as good as the business uses it can offer. Edge computing is one example where Wasm has begun to shine. This is because the ability to distribute compiled code to anything that can run a standard browser sets the stage for a bevy of edge-use cases, Torsten Volk, an analyst for Enterprise Management Associates, told The New Stack. 

“Compiled code typically runs a lot faster than code that first has to be interpreted by host devices. This enables an increased level of functionality, e.g. enterprise applications or machine learning capabilities, to edge devices, as less CPU and power resources are consumed,” Volk said. “Wasm brings the advantages of the now defunct Flash or Silverlight technologies to any browser, but without being tied to any specific vendor.” 

Wasm’s community-driven approach should address the security and compatibility challenges that “killed off these other client technologies,” Volk said. “In addition, this enables JavaScript developers to call compiled C++ functions and vice versa, making the advantages of compiled languages accessible to JavaScript developers,” Volk said.

The Business Pitch

So what can you do with Wasm? 

During the KubeCon + CloudNativeCon co-located event “Cloud Native Wasm Day Europe,” it was shown how a CMS compiled to Wasm supports cloud-computing company Fermyon’s website. WebAssembly also plays a big part in what the company offers. The idea was that as a new company entering a new space that it was important to have many SEO performance optimizations,” Matt Butcher CEO of Fermyon, said during his talk. “One of the important things to us is if we’re going to tell people about WebAssembly, then we need people to find us so that they can read about WebAssembly. And so we spent a lot of time up front designing the CMS so that the ordering of the source would be correct,” Butcher said. “We decided to follow all the specifications for best practices…and we built it all in so that essentially when an author is writing a piece of content, they don’t have to think about SEO beyond going ‘I need a good catchy title.’ So, that was a really interesting focus that we had early on.”

Fermyon’s founders also wanted to give the website designer the freedom “to do things the way he wanted,” allowing him to pick the theme engine, CSS framework and JavaScript libraries he wanted. These were all brought into a “a very hefty batch of features to be used in a system that people are saying, ‘I don’t know, it might not be production-ready yet. I’m not sure you can build anything,’” Butcher said during his talk. “So, we really took on this challenge of saying ‘we think we can build something really cool with WebAssembly as it is today.’”

The separation between compute and data on data stacks increases latency and causes other problems, which is especially cumbersome for streaming, edge connections and other distributed applications. A Wasm-based in-line computation can remove the silo between data and computes, Sehyo Chang, creator of the Fluvio project and co-founder of data-intelligence platform provider InfinyOn, said during his talk. This is done with data-streaming open source Fluvio’s implementation of Wasm to create a distributed stream platform that offers. 

The business implications are tremendous, Chang described. In order to create what Chang described during his talk as a “real-time economy,” existing latency across data streams and between databases and systems of record can be significantly reduced thanks to Wasm’s configuration. Applications and code are much easier to audit and to enforce security policies thanks largely to Wasm’s relatively simple binary computing structure. “This is where the trillions of dollars will be made or lost,” Chang said. “And the most important part of the tractor is latency.” 

In a data streaming application, Chang showed Wasm is a “game-changer” by combining isolation with portability “to allow us to reshape our compute infrastructure and datasets by flattening them into unified stacks instead,” Chang said. “This stack can go from edge environments to the cloud, and can span continents and different locations.

Adobe Takes Wasm to the Edge

Wasm is also much in use at Adobe. As Colin Murphy, senior software engineer, Adobe, detailed during his talk on CDN edge compute and Wasm/WASI platforms, and present and future Adobe applications. “We have at Adobe a lot of C++ code, and that’s great code for great products people want. And what WebAssembly allows you to do is bring that code into the browser,” Murphy said. “And so we wouldn’t have been able to bring Photoshop and Acrobat to the browser without it… Adobe’s done a lot of work to improve the WebAssembly standard for higher performance and better and  fast memory access, and things like that.”

Group Created with Sketch.
TNS owner Insight Partners is an investor in: The New Stack, fermyon, Docker.
THE NEW STACK UPDATE A newsletter digest of the week’s most important stories & analyses.