WASI - WebAssembly Everywhere!
Written by Ian Elliot   
Wednesday, 03 April 2019

What has got into the WebAssembly people? From being a faster way to run code in a browser, it now seems that it about to take over the world - just like JavaScript.

wasm

If you have been following the unfolding story of WebAssembly there is touch of madness in it all. JavaScript is the language of the web and it is embedded in all modern web browsers. There were, and still are, lots of options for making code run faster in the browser, but the one we seem to have settled on is WebAssembly.

How to describe WebAssembly?

Even if you know it well, an exact description is difficult. It is described as an assembly-like language that can be coded as binary or as human-readable text. It runs in the browser in the same sandbox as JavaScript code. It can't access the DOM and therefore has to rely on JavaScript for its UI. In the future it might be able to access the DOM and in this case it raises the question of what its close relationship with JavaScript was/is all about. The actual code is run by a JIT compiler, but this is just another way to implement a virtual machine.

At this point you might be thinking that this is just another bytecode-based way of implementing a language - think JVM or the .NET JIT - and this might be making you think why just the browser?

This is what the WebAssembly System Interface, WASI, is all about. You can think of it as a set of standard functions which connect WebAssembly to the operating system it happens to find itself in - a sort of standard library for WebAssembly with the library soaking up the differences between operating environments. The end result would be that you could write your program in a language of your choice - Rust, C or whatever - compile it to WebAssembly and with the help of WASI-compliant systems run it everywhere.

Yes, it's "Write Once, Run Anywhere" all over again and, in case you have forgotten, this was the promise of Java and we all know many reasons why it doesn't work as well as it should.

It is early days and so far only wasi-core has been worked on:

"wasi-core will contain the basics that all programs need. It will cover much of the same ground as POSIX, including things such as files, network connections, clocks, and random numbers."

You can see the idea in action in the following video:

None of this is super-clever, and similar things have existed before. Exactly how all of these libraries are going to come into existence isn't clear. It is clear that it is a lot of work and a great deal is going to be down to the detail of implementation.

It is also becoming increasingly clear that this effort isn't anything much to do with the web or web browsers. It could have been invented without a mention of a web browser and then extended to run in the browser. This is a completely new attempt at "Write Once, Run Anywhere" with a new low-level bytecode and VM.

WebAssembly with WASI is undeniably a  reinventing of the wheel. What isn't clear is if it will be a better wheel.

wasm

 

 

More Information

Standardizing WASI: A system interface to run WebAssembly outside the web

Related Articles

Not So Quick! WebAssembly

Mozilla Makes WebAssembly For The Rest Of Us

VIM In The Browser - The Magic of WASM

WebAssembly Explorer - A Learning Tool

WebAssembly Is Ready For Use

WebAssemby Another Milestone 

WebAssembly Takes A Big Step Towards Being Real 

Progress On WebAssembly 

WebAssembly Has Mozilla, Microsoft,Apple and Google Backing It 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


Kotlin Ktor Improves Client-Server Support
04/11/2024

Kotlin Ktor 3 is now available with better performance and improvements including support for server-sent events and CSRF (Cross-Site Request Forgery) protection.



JetBrains Improves Kubernetes Support In IDE Upgrades
12/11/2024

JetBrains has improved its IDEs with features to suggest the logical structure of code, to streamline the debugging experience for Kubernetes applications, and provide comprehensive cluster-wide Kuber [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Wednesday, 03 April 2019 )