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

Does anyone have any good success stories with WebAssembly in the actual context of using it on the web? That list of testimonials doesn't seem very inspiring as to whether or not the standard has seen actual production usage to justify being a recommended standard...


I use it in a web worker to compile, assemble, and link C programs into 8-bit ROMs: https://8bitworkshop.com/

I was using asm.js in the past, but WASM gives a noticeable and necessary performance boost.


That looks awesome! I noticed that you don't have Game Boy on there, not sure if it's useful to you but I started to make a WebAssembly port of GBDK: https://github.com/chrismaltby/gbdk-emscripten which I was planning to use in my Game Boy game maker eventually https://www.gbstudio.dev/


This looks awesome, great project!

Which specific CPUs or applications that you emulate really take advantage of the performance boost that WASM provides?


Thanks -- we use Emscripten/WASM mainly for running command-line compilers/assemblers (like cc65 and SDCC).

Right now the emulators are all in JavaScript (except for MAME) which makes integrating with the IDE's debugging tools a little easier. It's performant enough for now, since we only have 8-bit platforms at low clock speeds.

Integrating a C emulation library like https://github.com/floooh/chips should be doable, since it doesn't have any dependencies.


MESS/MAME can be compiled to WebAssembly now. You can emulate arcade games and whole computer systems in the browser. E.g. https://archive.org/details/win3_TemIM3x (Press the big play button)


We use it at IKEA to use a c-based OCR library in a pwa. And other small things like that. Like a legacy integrator.


could you name or recommend an open source library for OCR on web that is good enough for ikea ?


(Not GP) I haven’t tried it myself yet but tesseract.js’s demo looks promising.

https://tesseract.projectnaptha.com/


There are some very cool demos, such as running Doom 3 in the browser [0], but as for actual good success stories, I'd be willing to bet that many teams just haven't seriously considered it for large or involved projects due to it not yet being fully supported everywhere, not an official W3C recommendation (at the time), etc.

[0] http://www.continuation-labs.com/projects/d3wasm/


Ebay wrote up their experience shipping a WASM-powered barcode scanner. [1]

[1] https://tech.ebayinc.com/engineering/webassembly-at-ebay-a-r...


We use it for the end-to-end encryption implementation in Riot.im on Web; from memory it sped up the asm.js emscripten based implementation by a factor of about 3x, and also is a (slight) improvement in terms of risk of timing attacks.

Edit: here's the PR for switching from asm.js to WASM, in case anyone's interested: https://github.com/vector-im/riot-web/pull/7385/files apparently it merged in Oct 2018.


I've been developing a WebAssembly image processing library, and its performance has greatly surpassed JavaScript's, allowing for much faster and more performant image processing on the web.

I'm excited to see how I can improve upon it in the future, and make it even faster! It's on GitHub here, any feature requests or suggested improvements would be greatly appreciated too: https://github.com/silvia-odwyer/photon


We currently use wasm on the Adobe XD team for rendering shared prototypes in the browser. It allows us to share C++ rendering code across desktop and web and has been a massive success for us.

The browser support is good enough for our customer base, as it works across all operating systems and mobile devices, and we can fall back for asm.js for IE11.


https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor

Using the whole .NET ecosystem from browser, yea I think there's some good success stories ;)


I think this speaks of huge potential, not actual success. I'm really, really hopeful that blazor becomes something real with long-term committment but not fully convinced yet it's not the new silverlight. I hope these fears are unfounded but hesitant to go all-in as a first mover. W3C support is a positive step.


Figma uses it for their design editor.

PSPDFKit uses it for their pdf editor.

Unreal Engine/Unity uses it for their browser support.

It's used in production in many places either as modules or entire apps.


1password recently moved their browser plugin too https://blog.1password.com/1password-x-may-2019-update/


Figma uses Emscripten which is technically not Webassembly (to my knowledge)


Emscripten has been able to compile to WASM since before WASM was implemented in browsers. It became the default output earlier this year.


Some more detail: Emscripten has defaulted to emit wasm even earlier, in May 2018. The change this year was to switch how that wasm is emitted, from the old fastcomp+asm2wasm path to the new LLVM wasm backend.


I was actually thinking about the switch from asm.js to WASM (v1.38.1) but apparently that was last year. Whoops!


Emscripten has a WASM backend, it was originally JavaScript only.


Not sure if this is what you’re looking for but I’m using it to embed SQLite in an app that’s both desktop (electron) and web-kinda-sorta. I say kinda-sorta because really what we’re doing is embed SQLite (and other dependencies) in an html page so our users can just open it straight up in a browser without having to be online or connected to any other systems, and still able to work (albeit read only for now.) The download time doesn’t matter to our users (and more often than not the file is loaded from a local file: url anyway) and the startup time is not spectacular but sub-second at most currently, so we’re happy so far.

Except for some noob mistakes when implementing the PoC it’s worked remarkably well, much better than I though it would.


I never thought of replacing WebSQL like that. Cooool.

Pretty sure Electron provides IndexedDB though.

(Ref: https://nolanlawson.com/2015/09/29/indexeddb-websql-localsto..., vaguely https://nolanlawson.github.io/offlinefirst-2016-03/)


The decision to embed SQLite had more to do with query capabilities than storage. We need to expose a query interface that is both flexible and powerful, and ideally it’s not something esoteric. We need something BAs can pick up without much or any additional training. With SQLite we both get the query engine and storage, but really it’s the former that’s important. While it may have started as a “what if” kind of PoC I think it’s gonna stick, unless we can find something that essentially gives us SQL the query language (superset is fine, subset not so much) and whatever storage backend is available, be it IndexedDB or something else. We tried various options, like AlaSQL and others, but embedding SQLite was pretty painless and gives a lot of bang for the buck.

The only downside so far is that the embedded size is quite large, so we do take a small hit in startup latency (sub second still) and if we ever end up having a requirement to work across the internet (I doubt it) it’s going to hurt because we’d be looking at a 3mb+ download (quite cacheable though.)

Anyway, point is our need was mainly SQL the language and not so much the storage, that’s kind of secondary, though SQLite really makes that part easy too.


The thing is, I can't/don't disagree with you, in terms of arguing for SQLite over alternatives. Hearing the practical specifics of your edge case is (depressingly) insightful.

I just realized the links I posted didn't include the article I had in mind when I went link-digging (and didn't properly check the results, woops). I found it: https://nolanlawson.com/2014/04/26/web-sql-database-in-memor...

Potentially interestingly, I re-found the link above via hn.algola.com, which also found me the comments (for the only time the above link was posted), at https://news.ycombinator.com/item?id=7661236. The top comment thread there points to https://github.com/kripken/sql.js, which was started pre-WebAssembly but now builds for WASM, and the network tab in devtools is telling me it's a 497KB download. It says it takes the position of providing a first-class JavaScript API instead of C bindings, and that you have to implement your own save/load<->import/export layer. You may have already discovered and discarded this possibility.

FWIW, if using SQLite does stick, I reckon that an article (even a small one) about the journey/decision process/implementation gotchas/etc - and particularly details about the use cases, and why SQLite shines for your scenario - would probably be received very positively.

Thanks for replying! (My fast response time was due to fun timing: I literally just opened my laptop this morning, checked HN, and saw your comment posted "0 minutes ago" :D)


I work for Tableau, we've been using it for over a year to handle local map interactions, and soon it'll be powering our animation system on the web.


Is there anywhere I can see this animation system in action?


https://www.youtube.com/watch?v=wYkP51pO11E

You can jump to 47 minutes in to catch a little bit of the web animation in action, but as it was over conference WiFi, it was a bit wonky.


www.figma.com is built on WebAssembly (C/C++ language) and written a great deal of content on blog


Still working on this myself, but I'm using wasm to allow usage of a Rust library for parsing Rocket League replay files. I already had a binary utility that I could share with people who needed it, but it's a lot easily to just send them to a webpage where they upload their files and get a downloadable csv output.


I work on a project that has used it in a few places such as: running graphviz in the browser, and using various cryptography libraries cross compiled from C in the browser. In my experience it's early days still. Tooling is fragile and runtime memory management rudimentary.


I believe the Glimmer VM (Ember's rendering engine) was/is being moved to WASM.


Good questions. WASM at this point seems more a locus of JS hate than anything practical. To create something cool, novel, and useful should be the goal, not avoid or use a certain language.


There's a pretty stark difference between those working in and with WASM, and people commenting on the sidelines. Almost everyone involved with WASM itself sees it as complimentary, and explicitly is not trying to "kill javascript." Random commenters on the internet do say this a lot though.


Cool. Thanks


WASM isn’t very practical yet because it isn’t fully formed. There isn’t support for DOM access or parallelism, never mind the ecosystem. It’s a really ambitious project, and writing it off as “locus of JS hate” because it hasn’t completely changed the game in such a short time frame is really short sighted. It would be a fairer test to give it 5 years.


I'm not writing it off. I think it's a good idea to bring more options to the web. I tried it last year, but as you state and I agree, it's not ready yet.

In my experience in SF I encounter many never-JSers. Being a JS fan, for certain things, I don't get the hate. So maybe I feel threatened in a way, but I'm not going around wishing for the death of python or Haskell. That's all. I am reading random internet commenters and getting slightly upset. That's on me.


I think you get that with any language. People are very attached to how they’ve learned to solve problems and the set of tradeoffs they tend to value. I like Go and I can’t tell you how often I see even outlandish criticism (for a long time on r/programming, commenting “it is impossible to build a software product in Go because the type system is too weak” was a great way to get upvotes, especially if you followed it with “but I really like <fully dynamic language>”). You just have to try to understand which parts of the criticism are valid and improve your own understanding.


I wouldn't say it's hate towards JS but I think the evolution of JS vs the evolution of web and its use cases have not increased at the same velocity, latter being faster. JS has had to have a lot of scaffolding added to increase its use but WASM now comes in with the understanding of the modern requirements. However, I don't think it's either one or the other, it'll depend on the use-case.

I can't imagine JS will go anywhere anytime soon, especially since it still needs to be called from DOM manipulation,but the ability to code a full stack in a single non-JS language and run it at near-native performance is going to be very useful as more apps become web based and complex. Even from a skills point of view, you can now have backend and front-end developers skillsets are slightly more merged so easier to swap around resources.


You’ll be happy next time you npm import something time sensitive that requires computation, and that you can just use from js for free.

Think about how you would do ML with just python. That’d be insane. And thankfully the packages you need are implemented in c or cuda with python bindings. 99% of ml people never see the insides of np, sklearn or tf. But you’re glad these aren’t implemented in python.

Similarly, you’re glad for webgl if you need to do lots of parallelizable computations (cfd, ml, 3d). But glsl was never bashing at js. Just that using js for these task isnt feasible.

Similarly, now you can use fast code from js. Essentially, you have a bunch of matrices use webgl, otherwise wasm. And orchestrate everything from js. Like ml peeps do with python, c and cuda.

For the better or the worse...


I would like to use WASM for JavaScript, I wonder if that is possible or practical?


Yeah, we should all write js on the web and cobol on the server. Think about how good cobol could have become.


Probably the most prominent use of WASM at scale is cryptocoin mining. Coinhive estimated it run at 65% performance of native code.

https://www.forcepoint.com/blog/x-labs/browser-mining-coinhi...




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: