DEV Community

Cover image for WASM is AWSM

WASM is AWSM

vibalijoshi on October 05, 2021

We live in times where you learn JS to write server side code and desktop apps (electron), and you also learn C++ / Rust to create browser apps. ...
Collapse
 
ashoutinthevoid profile image
Full Name • Edited

It's a bit of a nitpick, but

Let's say you make a game using unity and C++ and you want to make it available for the web (as in the browser) but for that you would require to learn JavaScript.

Unity uses C#, and it's already multiplatform. Right idea, but maybe not the right example. A more direct example would be the existing port of the Doom 3 engine(which is C++) to wasm.

There's also a lot of caveats being discussed. Among them, a growing tendency for organizations to disable wasm by default due to it's abuse by nefarious crypto mining implementations. Not a showstopper, but it can be a concern to resolve before making wasm an integral part of your application (potentially without fallback).

Wasm is definitely exciting (perhaps moreso outside the browser, for me), but there are some thorns to worry about on this rose bush.

Collapse
 
vibalijoshi profile image
vibalijoshi

Ahh right! Thanks for pointing it out.

Great view about the possible not so good things about wasm, keeps the whole sentiment balanced!

Collapse
 
ashoutinthevoid profile image
Full Name

My pleasure, I'm glad it wasn't received as too negative.

The more you and others like you produce these articles and spread awareness, the more people we'll have to help shepherd the future of wasm. There's so much great potential to be realized.

Thread Thread
 
vibalijoshi profile image
vibalijoshi

Agreed! 🀩

Collapse
 
pedro profile image
Pedro M. M. • Edited

WASM is awesome, is multi-threading ready yet? I can't wait to be able to code some super efficient multi-threaded module in rust and just call it from js. Also, electron apps could benefit greatly from this.

We live in times where you learn JS to write server side code and desktop apps (electron), and you also learn C++ / Rust to create browser apps.

This is a very interesting discussion. Anyone that have tried to build a desktop application with both: native bindings and css/html/js knows how delightful the experience of designing something with CSS is vs native bindings. This is one of the main reasons why electron apps tend to be more visual appealing and explains their increasing growth in the market (besides them being multi-platform, ofc).

WASM is a step in the right direction and could greatly improve the developing (and user) experience of desktop apps

Collapse
 
ashoutinthevoid profile image
Full Name • Edited

Maybe there's a specific point about multithreading im not giving enough weight, but Electron apps are already benefiting from using Rust.
Discord uses it in their client (noted here though sparse on details; not the focus of that article). Aside from wasm, you also have the option of compiling a native node module. Example. And there are other ways to call a separate binary to do work that isn't ideal for Js.

Personally I didn't find the neon bindings any harder than wasm-bindgen, and in my use cases thus far I haven't had a reason to prefer wasm. It's a cool option to have though!

Wholeheartedly agree on the ease of web style gui development compared to other options.

Collapse
 
rreverser profile image
Ingvar Stepanyan

Yes, multithreading has been stable for some time now. Recently I wrote a guide on configuring and using it from various environments: web.dev/webassembly-threads/

Collapse
 
vibalijoshi profile image
vibalijoshi

Yes agreed! WASM is really exciting and a lot more people can now contribute towards web!
Also give this a read: rustwasm.github.io/2018/10/24/mult...

Collapse
 
jannetrosel profile image
JannetRosel

Hey, it’s good to be back. Thanks for having me. I’m really excited about this topic today as well. Rituel Vaudou Pour SΓ©parer Deux Personnes

Collapse
 
ben profile image
Ben Halpern

Great post

Collapse
 
vibalijoshi profile image
vibalijoshi

Thank you so much 🀩

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

Can't wait for more tutorials that actually interact with DOM.

Collapse
 
spiritupbro profile image
spiritupbro

this is so cool, i just know today that we can basically create wasm script using other language than rust thanks for the info

Collapse
 
vibalijoshi profile image
vibalijoshi

Yeah WASM is really cool!
Thanks for the appreciation πŸš€

Collapse
 
tamusjroyce profile image
tamusjroyce

Deno runs wasm natively. C# can as well (nuget package). it isn’t just a front-end technology. I am curious if there will be a RISC-V open source processor that can run it via hardware.

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
poker profile image
Poker9x

test