DEV Community

Cover image for What is WebAssembly and why it is a game changer?

What is WebAssembly and why it is a game changer?

Aryan Kaushik on April 24, 2022

WebAssembly (Wasm) WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed a...
Collapse
 
joelbonetr profile image
JoelBonetR 🥇

Theoretically it's correct, but when you test WASM vs JS at runtime you'll see that in most cases JS performs better, maybe not the first run but as soon as JIT enters in the equation.

It has pros and cons, just like every tech you can play with. It's just that the pros are not enough to be a real game changer or to substitute JS.

Collapse
 
aryank21 profile image
Aryan Kaushik

Wasm is not there to compete with JS but infact to support each other. Executing things directly to the browser and much faster is the main usp. But if we talk about the comparison I would definitely agree with your point @joelbonetr .

Collapse
 
joelbonetr profile image
JoelBonetR 🥇 • Edited

Oh sorry, I was thinking about those compile/transpile to JS trend that show up a while ago.

You can see it in
Kotlin
C#
Emscripten, Emception to workaround it with C++...
The same way we can found multiple tools for many other languages.
There's even a project to convert PHP into JS, take a look

Some of them are well supported others don't (the same happens on WASM world).
There are two main ways to code with any language and run it into web, Compile/transpile it into JS or doing the same to WASM. (I say main because there are others out there).

Never had the need nor I wanted to take a try on coding in a different language and running it as JS or WASM after a conversion, it's something that I've as very very very low priority in my list but I'm curious about the marketshare or the real needs that it can cover IRL.

I also would like to know whether one approach is better than the other and what are the key points to decide. If you have this knowledge please share and tell me something through a message (or mention me), I'll be much appreciated 😄

Thread Thread
 
aryank21 profile image
Aryan Kaushik

Hi @joelbonetr . Though I'm also new to Wasm and don't have much development experience like you sir, but I'm very much facinated by wasm. Answering you question, Wasm is the 3rd generation of cloud computing, initially it was made to compile code on browser through its binary conversion property but Its more appealing property is towards server side for fast and securing processing work using Rust lang.

The purpose of my post was to aware the folks about wasm as many don't know its existence yet. It is currently in its pre famous phase as docker was in 2013.

Thread Thread
 
joelbonetr profile image
JoelBonetR 🥇

Ouch! Anyway remember about me when you decide to research more on that :D

I would love if you can expand the Use Cases and what benefits it can bring over alternatives more stablished on the market.

i.e. I code PWAs sometimes and never thought on using WASM on them.

It's always good to see younger people pushing knowledge on a tech or another and we oldies can also learn from you guys! I've not much knowledge on web3 (yet) nor in wasm so here's my follow to read your future posts :)

Thread Thread
 
aryank21 profile image
Aryan Kaushik • Edited

yeah sure. Alot of stuff is coming up soon.

By the time please Check enarx.dev/ for a wonderful application used for security using TEEs.

Thanks for the suggestion sir!

Collapse
 
dhravya profile image
Dhravya

JavaScript has been around since soo long, wasm will get there too

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

Or not, time will tell 😆

Collapse
 
aryank21 profile image
Aryan Kaushik • Edited

yeah, absolutely agree with you pal @dhravya !

Collapse
 
aminmansuri profile image
hidden_dude

I like the idea of programming in one language. For example, using your favorite language on the backend and it generating a frontend as a compiled module. But using the same programming language for both.

Of course, people who program with NodeJS already have that. And it seems to have a lot of traction.

But debugging seems like it could be harder since Javascript is just there already for us.

But mostly it's an opportunity to take all our existing tech and tooling and start all over again. Hurray!

The software industry is obsessed with starting from scratch every few years.

Collapse
 
pinotattari profile image
Riccardo Bernardini • Edited

A really interesting advantage of WASM is that there is on github a project to compile from Ada to WASM. In this way you can take advantage of the robustness and easiness of maintenance of Ada for your web development (no more "type promiscuity")

Oh, and do not forget the possibility of formal checking your code

Collapse
 
curiousdev profile image
CuriousDev

I think you should still add things which can be bad next to the ones which are good. For example if you are using Blazor (for C#) the initial load takes some time.

Collapse
 
aryank21 profile image
Aryan Kaushik

Thanks for the suggestion pal @curiousdev . I'll be posting new stuff very soon.

Collapse
 
jonrandy profile image
Jon Randy 🎖️

New?? It was first released 5 years ago

Collapse
 
mmuller88 profile image
Martin Muller 🇩🇪🇧🇷🇵🇹

Found it super useful and shared it in my communities. Do you might have GitHub references with cool usecases for WASMs?

Collapse
 
aryank21 profile image
Aryan Kaushik

Thanks for the appreciation @mmuller88.
You can visit madewithwebassembly.com/ for cool stuff

 
aminmansuri profile image
hidden_dude

But it is often churn for churn's sake. I believe that as the field matures we won't have such radical changes all the time, because abandoning so many platforms and frameworks and technologies only raises the cost over time and with very little benefit.

Unfortunately often the software industry seems to be more similar to the fashion industry than an engineering discipline. We don't technically need a new fad every couple of years. We only fall prey to large company interests when we do so.

 
aminmansuri profile image
hidden_dude • Edited

MS does it's own churning. ASP.Net -> Webforms -> .Net core

But plenty of examples. Just when Java was getting mature and usable, many switched to Rails or Node.JS or whatever that is much less proven and had some of the same early mistakes that early Java platforms had. Then everything became more "client / server" with React, Angular, Vue, etc..

I've seen the web wheel invented over and over again. And I'm not necessarily seeing much benefit in these tech changes. Some of the new stuff can be quite complex if not more complex that some of the earlier technologies.

Collapse
 
aminmansuri profile image
hidden_dude

nevertheless.. every few years, the industry abandons some well established ecosystem and starts all over because some company convinces developers to switch to their tech