DEV Community

Cover image for WebAssembly is easy — a hello world example

WebAssembly is easy — a hello world example

Dorin on January 01, 2020

Introduction I like to think of WebAssembly as of Assembly. It gives you a few simple building blocks that you can arrange and combine t...
Collapse
 
mdamaceno profile image
Marco Damaceno •

Man, this article surprised me! I didn't know how easy WebAssembly is. I didn't even know about calling it inside a javascript code. The name "Assembly" scares me. Now, I intend to learn this language though.

Collapse
 
dorin profile image
Dorin •

I'm glad this inspired you to learn more!

Collapse
 
rolandcsibrei profile image
Roland Csibrei •

I used the inline technique to precalculate large datasets in my current project and the speed gain is very very mentionable.

Thanks for the article! Have a great day!

Collapse
 
dorin profile image
Dorin •

that's fantastic!

Collapse
 
not_jffrydsr profile image
@nobody •

Isn't it strange how WASM looks much like common LISP ? 😎

Collapse
 
devhammed profile image
Hammed Oyedele •

I am about to say this 😂😂😂

Collapse
 
seniru profile image
Seniru Pasan Indira •

Same 🤔

Collapse
 
darthwalsh profile image
Carl Walsh •

I'm guessing this works only server-side, but to actually use WASM you'd probably want this in a browser, right? Could I generate a binary using inline-webassembly and serve it from my express server?

Collapse
 
dorin profile image
Dorin •

Good question! This will work both back-end with an Express server and front-end in a browser.
The way inline-webassembly works is that it generates and executes the binary on the fly, so this will not be a separate step.
Let me know if you have questions on how to do that.

Collapse
 
amodeusr profile image
Amodeus R. • • Edited

When every programming language requires us to write at most is print("hello word"), or console.log("hello world"), I woulnd't call that simple. The worst one is Java, but even it is simpler that what is shown here.

Collapse
 
gabbersepp profile image
Josef Biehler •

I developed many years with X86 ASM just for fun. I like the idea applying WASM code inline :-D
But I am not sure if my colleagues also support this :D

Collapse
 
dorin profile image
Dorin •

I know what you mean :) I'm not using this at work either.

Collapse
 
otumianempire profile image
Michael Otu •

Up and running.. Thanks