I’ve been wondering about this for a while and haven’t really found a great answer for it. From what I understand, WASM is:

  • Faster than JavaScript

  • Has a smaller file size

  • Can be compiled to from pretty much any programming language

  • Can be used outside of the browser easier thanks to WASI

So why aren’t most websites starting to try replacing (most) JS with WASM now that it’s supported by every major browser? The most compelling argument I heard is that WASM can’t manipulate the DOM and a lot of people don’t want to deal with gluing JS code to it, but aside from that, is there something I’m missing?

1 point

Nothing is stopping them. Have you seen Leptos? https://github.com/leptos-rs/leptos

permalink
report
reply
1 point

JS have momentum, a lot of it.

permalink
report
reply
5 points

So I gotta have to break out the xkcd comic again? Cause I will

permalink
report
reply
2 points

Do it do it do it! 🤣

permalink
report
parent
reply
3 points

On the subject of dom manipulation from wasm I highly recommend this video https://youtu.be/4KtotxNAwME. It’s from leptos author, one of the more popular wasm framework. The TLDR is that modifying the dom isn’t the bottleneck for wasm.

permalink
report
reply
3 points

Here is an alternative Piped link(s): https://piped.video/4KtotxNAwME

Piped is a privacy-respecting open-source alternative frontend to YouTube.

I’m open-source, check me out at GitHub.

permalink
report
parent
reply
4 points
*

IIRC a startup tried to exactly that… It’s wasn’t any faster and is actually harder to develop.

EDIT:

Sorry ignore these videos. I don’t remember which YouTube video it is. But more importantly Rust + WASM got really better than JS these days.

permalink
report
reply
5 points

The video is essentially saying the exact opposite of what you are saying. It’s showing leptos to be much faster than react and I know primeagen doesn’t think rust is harder develop.

permalink
report
parent
reply
1 point

My bad. I can’t find the actually video but there exits a startup that shutdown because Rust/WASM performance wasn’t any better on top of that it’s was harder to develop with Rust. But as my edit to my previous comment shows things got better for Rust. It’s no longer the case.

permalink
report
parent
reply
2 points

Here is an alternative Piped link(s): https://piped.video/watch?v=461735zrjzY

Piped is a privacy-respecting open-source alternative frontend to YouTube.

I’m open-source, check me out at GitHub.

permalink
report
parent
reply

Programming

!programming@programming.dev

Create post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Community stats

  • 3.5K

    Monthly active users

  • 1.7K

    Posts

  • 28K

    Comments