Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As someone who is bad at JS I really hoped webassembly would let me leapfrog JS/React etc. Is it time to start using it?


I'd like the answer to be “yes”, but at this point if you need to ship software I'd say “no”. There are wasm counterparts to React (my favorite right now is yew.rs), but they're self-described as not production-ready. Overall, the tooling is just much more developed on the JS/React side. Unfortunately.

That said, you can get plenty of mileage out of using React as a frontend and wasm for the application core. I believe this is what Figma does. And you can sidestep the DOM entirely and use your own UI renderer, which seems to be what Adobe is doing here. https://makepad.dev/ is another (absurdly impressive) example of that approach, but that's a very involved approach!


There are a few things already here or “coming soon” that will 100% let you leapfrog JS.

WASM still has no concept of garbage collection which means that by default it’s limited to a smallish number of languages that are viable. That’s changing in the not too distant future it seems as the plans for garbage collection are well underway already.

It also has no ability to do DOM manipulation meaning you end up in a scenario like the one in the article where “algorithms” end up in wasm and the UI in web components / JS.

I believe that too is going to change at some point.

As for where things stand RIGHT now in 2021 if you want to skip JS I would say it probably depends a lot on what you want to build. I think for a lot of B2B enterprisey apps that mostly run on Desktop devices Flutter is already a viable option there and generally a much nicer experience.

The performance / accessibility right now isn’t at a level where it would make sense for a bunch of other options but as I mentioned elsewhere in this thread it is barely out of beta by a couple of months. It’s improving a lot at a pretty rapid pace and is built upon solid tech choices and open standards. I think it has a decent future ahead of it.


Thanks I wasn't sure why wasm was mostly limited to C++/Rust right now but the memory makes sense.

Flutter is great except for Dart - another language.


I felt the same way my desire to learn a new language was somewhere between low and none at all.

I’m happy to say when I’m wrong though, it ended up as probably my favourite language of all after not too long.

It’s often described as the love child of Java and JavaScript where they took the best from both and got rid of the most hated parts of both too. But it ends up as a really nice and performant language to build apps in and is supported by a lot of amazing dev tooling to make life easier.


That sounds awesome, I'm going to try it out, thanks.


No, layout is all CSS with some JS mixed in, and will be for a long time. Webassembly will help accelerate heavy mathematical computations such as canvas graphics.


You could hypothetically use Webassembly to build your entire application around a canvas and either render directly with canvas calls or WebGL, but it would somewhat miss the point of the web unless you're explicitly building a game or something.


This is what Figma is doing for their main UI, they reimplemented everything [1]

[1] https://www.figma.com/blog/building-a-professional-design-to...


Flutter also does this but has an option to fall back to regular DOM elements on lower end devices if needed.


Yes




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: