Live data from Hacker News

WebAssembly

developer.mozilla.org

21–30 of 98 posts

Re: WebAssembly

#21
post #7

I absolutely love the new MDN where every article is just a file on Git. For example, the source for this article is here: https://github.com/mdn/content/blob/main/files/en-us/webasse... You can find the link to the source of any article at the bottom of the page.

It's a pretty common blogging method. Google and many other orgs do that too.

Re: WebAssembly

#22
post #7

I absolutely love the new MDN where every article is just a file on Git. For example, the source for this article is here: https://github.com/mdn/content/blob/main/files/en-us/webasse... You can find the link to the source of any article at the bottom of the page.

It's a pretty common blogging method. Google and many other orgs do that too.

Thank you for your contribution

Re: WebAssembly

#23
post #2

Something that I've been looking for as I try to learn more about WebAssembly is good examples of tasks that, when converted from Javascript to WebAssembly, would be good uses of WebAssembly for performance or memory or other reasons. Does anybody have a link to a blog post or good documentation like that?

The YouTube series “HTTP 203” has a couple of great episodes on WebAssembly. Here’s one I like as it is both accessible and in depth: https://youtu.be/S0NQwttnr1I

Re: WebAssembly

#24
post #7

I absolutely love the new MDN where every article is just a file on Git. For example, the source for this article is here: https://github.com/mdn/content/blob/main/files/en-us/webasse... You can find the link to the source of any article at the bottom of the page.

It's a pretty common blogging method. Google and many other orgs do that too.

Is it? Can you provide some links to examples?

Re: WebAssembly

#25
post #2

Something that I've been looking for as I try to learn more about WebAssembly is good examples of tasks that, when converted from Javascript to WebAssembly, would be good uses of WebAssembly for performance or memory or other reasons. Does anybody have a link to a blog post or good documentation like that?

I personally use it to simplify and synchronize encryption logic between client side and server side; makes things a breeze especially if you don’t want to mess with Javascript’s crypto APIs.

Re: WebAssembly

#27
post #2

Something that I've been looking for as I try to learn more about WebAssembly is good examples of tasks that, when converted from Javascript to WebAssembly, would be good uses of WebAssembly for performance or memory or other reasons. Does anybody have a link to a blog post or good documentation like that?

A few wasm projects I've worked on:

- An in-browser crossword puzzle generator: https://crossword.paulbutler.org/ (source: https://github.com/paulgb/crossword-composer)

- A multi-player word game: https://redwords.paulbutler.org/

- A library for synchronizing state between clients, used for that word game: https://aper.dev/ (source: https://github.com/aper-dev/aper very WIP right now)

In my experience, the single biggest perk of using WebAssembly is that I can use a language I'm very productive in (Rust) compared to JavaScript. Everything else is secondary. That said, I think these projects have specific advantages by virtue of being WebAssembly:

- The backtracking search used for the crossword puzzle generator is carefully implemented to reduce memory allocations. This would be tough to do in JavaScript, and I believe it's partly responsible for its performance.

- The word game uses a compression algorithm that benefits very noticeably from wasm-opt, to the point that I can't run it without it. Given that wasm-opt takes a non-trivial amount of time at compile time, I suspect the JavaScript JIT would be slow at doing something similar at runtime. This is just conjecture, I haven't checked.

- What Aper does just wouldn't be possible without Rust features like Serde and macros.

Re: WebAssembly

#28
post #24

Earlier quoted context omitted.

It's a pretty common blogging method. Google and many other orgs do that too.

Is it? Can you provide some links to examples?

Dive into the JAMstack and file-based CMS world. Netlify is kinda the big name here: https://www.netlify.com/ Push markdown content to git -> Netlify builds using your file-based CMS of choice -> HTML published as blog, etc.

Re: WebAssembly

#29
post #2

Something that I've been looking for as I try to learn more about WebAssembly is good examples of tasks that, when converted from Javascript to WebAssembly, would be good uses of WebAssembly for performance or memory or other reasons. Does anybody have a link to a blog post or good documentation like that?

[deleted]

Re: WebAssembly

#30
post #2

Something that I've been looking for as I try to learn more about WebAssembly is good examples of tasks that, when converted from Javascript to WebAssembly, would be good uses of WebAssembly for performance or memory or other reasons. Does anybody have a link to a blog post or good documentation like that?

Figma: https://www.figma.com/

It's a design tool that runs entirely in your browser as a WebAssembly-based frontend tool (coded in C++ IIRC). Go kick the tires and play around with it--you will be amazed how fast, fluid and downright native the experience feels.

IMHO I think we're going to see more and more frontend experiences like this in the near future. For certain classes of complex apps we're starting to see the overhead of all the frontend JS cruft, polyfills, reactivity, etc. are just getting out of hand and destroying browsers on low-spec phones and machines. A little Go/C++/Rust/AssemblyScript, etc. app compiled to WebAssembly interacting with the DOM directly is incredibly fast and space efficient. The build system for something like Go or Rust is so much more sane and easy to use vs. a complex modern JS Webpack setup too.

edit: More details here: https://www.figma.com/blog/webassembly-cut-figmas-load-time-...

Post reply on HN