There goes my plan to use js code generation at runtime to make my algorithms faster. Doing this with wasm will be much harder.
While in JS you would probably use https://www.npmjs.com/package/binaryen
141–150 of 164 posts
There goes my plan to use js code generation at runtime to make my algorithms faster. Doing this with wasm will be much harder.
While in JS you would probably use https://www.npmjs.com/package/binaryen
Isn't Asm.js better just for the fact that I can call web apis directly without shims? Or moving data in and out? I'd love to commit totally to webassembly but still seems very limited, am I wrong?
Wasm can also call web apis directly. The overhead you hear about is in translating complex types like nested dicts etc between formats. But wasm runs inside the js runtime
Earlier quoted context omitted.
What’s sad about that is we could have had a clean, native, desktop Figma application.
This is a lazy statement based on extremely vague handwaving about desktop v.s. web. It's not the 2010s anymore. Time to drop these generalities. Users were migrating to us _from_ desktop applications. Collaboration was the key differentiator, but a less well known reason was that improved performance, including but not limited to the support of large design systems, was also a commonly cited reason among paying cust…
> asm.js was Mozilla’s response to the question posed by NaCl and PNaCl: how can the web run code at native speeds? Had it been today, Chrome would have just pushed NaCl and PNaCl no matter what, and then everyone would complain why Safari and Firefox aren't keeping up with "Web" standards.
I still maintain the notion we're in the wrong timeline, one where PNaCl died and instead of a worthy, timely successor we end up being boiled alive in a soup of Electron apps. I really thought, for a time, that we'd be doing everything in the browser . And in a way that's increasingly true, but it all just feels worse than ever. I like WASM and I want to like WASM but the rate of maturity within the ecosystem is inc…
It gives a sandboxed directory on the local computer you can read and write to (user decides what rights you get). It's what the web version of VS Code uses to edit local files.
It's wonderful. Suddenly you can blend local and remote systems together the way they should operate, without having to have local apps with god-knows-what rights.
It's not implemented in Firefox. I understand it is a risky API, but wow it makes a huge difference to what is possible.
For example, I did this for a recent Kaggle comp: https://github.com/nlothian/gemma-data-agent
It runs Gemma E4B in the browser, and Python (Pyodide) and SQL (DuckDB) in WASM.
You can give it a directory with some CSVs, tell it to load them and then it can run analysis on them.
The whole Web platform is great - I just wish I could say it runs in Firefox too.
Hmmm, need a asm.js -> WASM transpiler maybe. (compiling legacy code with legacy versions of Emscripten is quite frustrating, almost as bad as updating your JS code to be compatible with accumulated changes in the Emscripten ABI)
Earlier quoted context omitted.
What’s sad about that is we could have had a clean, native, desktop Figma application.
This is a lazy statement based on extremely vague handwaving about desktop v.s. web. It's not the 2010s anymore. Time to drop these generalities. Users were migrating to us _from_ desktop applications. Collaboration was the key differentiator, but a less well known reason was that improved performance, including but not limited to the support of large design systems, was also a commonly cited reason among paying cust…
I never communicated this to the team, but I doubt I was alone. All that is not to knock you down, I just wanted to share that being a proper native desktop app does matter to some people for practical reasons other than performance, even if you’re not aware of it.
> asm.js was Mozilla’s response to the question posed by NaCl and PNaCl: how can the web run code at native speeds? Had it been today, Chrome would have just pushed NaCl and PNaCl no matter what, and then everyone would complain why Safari and Firefox aren't keeping up with "Web" standards.
I still maintain the notion we're in the wrong timeline, one where PNaCl died and instead of a worthy, timely successor we end up being boiled alive in a soup of Electron apps. I really thought, for a time, that we'd be doing everything in the browser . And in a way that's increasingly true, but it all just feels worse than ever. I like WASM and I want to like WASM but the rate of maturity within the ecosystem is inc…
The C# toolchain for WebAssembly is pretty good. You can do a lot with Avalonia and Uno:
Here's a C# clone of Visual Basic compiled to WebAssembly:
Earlier quoted context omitted.
I’ve found canvas + WebAssembly works great together! Here’s an example of Sudoku running in WebAssembly (it was vibe coded in Zig) and then rendered to canvas. The interface between the wasm module and the browser is function calls for keyboard and mouse events, and then another that renders to a pixel buffer to copy to the canvas. https://qip.dev/play-sudoku And this approach also works for simple forms, such as a…
Do you really think this "works great"? I'm using a brand-new MacBook Pro with a high-end M5 processor, and this site is extremely unresponsive for me. Huge latency between clicking and getting feedback. It also breaks accessibility. The QR code use case seems far more reasonable to me, you're generating a static image.
And this is still a killer feature of asm.js, even if it's not 'supported' it's still implicitly supported.
EDIT: And also seriously just thanks to the people who invented asm.js, it was a brilliant idea, but it makes sense that it's not worth optimizing anymore.