Running JavaScript in WebAssembly with WasmEdge

THETECHPLATFORM.COM

“Hang on”, I hear you say, “WebAssembly runs within JavaScript, why would you want to run JavaScript within WebAssembly?”. Good question!

WebAssembly is increasingly being used as a universal runtime for cloud applications, for example as a host for serverless / FaaS or for sidecar applications in a service mesh. However, in those cloud-native use cases, developers often want to use JavaScript to write business applications. That means supporting JavaScript applications within a WebAssembly runtime.

This blog post describes how to run the QuickJS JavaScript engine within the WasmEdge WebAssembly runtime. How the tables have turned!

WebAssembly Where it Belongs: In the Cloud

CONTAINER-SOLUTIONS.COM

While the above article alludes to the many uses of WebAssembly in the cloud, this article takes a deep-dive. First, it looks at what makes this runtime so appealing, followed by a number of different cloud-computing examples.

Minor point - it is great to see people getting so excited about WebAssembly as a cloud computing runtime. I share that excitement. However, WebAssembly doesn’t belong in the cloud. It belongs in the browser, the cloud and on IOT devices. It belongs everywhere.

Introducing the Disney+ Application Development Kit

MEDIUM.COM

Disney have enjoyed considerable success with Disney+, their direct-to-consumer streaming product, most likely having benefited from COVID. Similar to Netflix and other streaming providers, there is considerable demand from partners who want to embed Disney+ into their own set-top boxes and other hardware. Tackling this is a considerable challenge, “… we’d need to build an incredibly portable runtime that would run on everything from 10+ year old MIPS based devices to modern x64 processors and GPUs.” WebAssembly was key to the solution.

Disney+ SDK

The Application Developer Kit (ADK), contains a WebAssembly runtime, that hosts the client application, which is written in Rust and compiled to WebAssembly. This results in a platform-independent client application, which is downloaded from the internet, allowing for rapid deployment of application updates.

2D Predictive-Corrective Smoothed Particle Hydrodynamics

NETLIFY.APP

Time for a flashy demo - this time, a Rust, WebAssembly and WebGL fluid simulation. You can find the sourcecode on GitHub.

On the subject of Flash-y …

Some of the most iconic 9/11 news coverage is lost. Blame Adobe Flash

CNN.COM

Yes, we do have a growing problem with digital content that we can no-longer realistically access because the hardware or software ‘player’ has reached end-of-life. However, I think it is a bit harsh to ‘blame Flash’. This is a fact of life for technology. Anyhow, on a more positive note, this article does mention Ruffle, a Rust / WebAssembly re-implementation of Flash.