DEV Community

Discussion on: I am a JavaScript's biggest fan, Ask Me Anything!

Collapse
 
layzee profile image
Lars Gyrup Brink Nielsen • Edited

How will WebAssembly affect the future of JavaScript?

Collapse
 
weirdmayo profile image
Daniel Mayovsky

To my knowledge, WebAssembly is mostly used to enable teams to write applications in languages other than JavaScript. JavaScript does not need a compiler to get started in it. That being said, as long as large libraries like React or Angular are alive and have huge support from the community and teams that produce apps, JavaScript will not disappear.

FAQ on their GitHub answers the "replacement" question pretty well:

No! WebAssembly is designed to be a complement to, not replacement of, JavaScript. While WebAssembly will, over time, allow many languages to be compiled to the Web, JavaScript has an incredible amount of momentum and will remain the single, privileged (as described above) dynamic language of the Web.

WebAssembly is designed for Web to execute code as fast as native machine code, and that is where the name is from (Assembly language). It might affect very distant future of JavaScript, but it will not make a significant impact soon, unless there will be a necessity in its speed, which is not happening, because phones, computers, and browsers are only getting better.

Collapse
 
tux0r profile image
tux0r

because phones, computers, and browsers are only getting better.

If your software is inefficient, throwing more hardware at it will only help up to a certain point.

However, the one big thing missing from WebAssembly (yet?) is native support for DOM manipulations. As long as it's not there, WebAssembly is out for most people.

Thread Thread
 
layzee profile image
Lars Gyrup Brink Nielsen • Edited

For now we rely on JavaScript-based companion libraries to make DOM manipulations. I imagine this is how Blazor does it.

Thread Thread
 
kip13 profile image
kip

Check this

Thread Thread
 
tux0r profile image
tux0r

native support

But yes, thank you!

Collapse
 
layzee profile image
Lars Gyrup Brink Nielsen • Edited

I think that - for now - the main use case of WebAssembly is game engines, graphics rendering and similar computationally heavy applications.

Maybe it will add to the performance of Machine Learning or other AI in a JavaScript environment as well.