4 ms·
This is a popular negative remark when it comes to WebAssembly, and I'm getting a bit disappointed at how often it comes up. We really need to get past the floo
by JasonSage 10y ago
This is a popular negative remark when it comes to WebAssembly, and I'm getting a bit disappointed at how often it comes up. We really need to get past the flood of comments on having an assembly for the web. They're usually uninformed and opinionated (a bad combination), and do nothing to help real efforts that are in place to combat what they're complaining about.
Check the GitHub pull request below (linked from the article we're commenting on...). The WebAssembly spec includes a work-in-progress Text Format specifically to make it readable by JavaScript developers:
> This proposes an official text format for WebAssembly, aimed at browsers to use in "View Source", debugging, and related tooling. It uses a JavaScript-like syntax for readability and familiarity on the Web, though it differs from JS in several respects, as it aims to reflect the underlying WebAssembly language.
https://github.com/WebAssembly/design/pull/704 https://github.com/WebAssembly/design/pull/704
If you're strongly opinionated about WebAssembly having a readable format for the Open Web (and it would seem that many are with the volume of comments like this), then subscribe to this pull request. You'll have an opportunity to see the text format take shape and provide input on it. Developers are not oblivious to the number of subscribers on a PR or issue, so you'll also be making it known that it's important enough for you to be looped in on.
Please check out the Text Format pull and related links so that you can be informed about this issue.
edit: formatting
- dccoolgai 10y agoThanks for the link to that PR. That's good advice. The truth is, it's hard for me to read what they are recommending as the readable version. Maybe that makes me an idiot...certainly a lot of comments in this thread are suggesting that's the case... but I bet I'm not the dumbest guy who codes for the open web... so for that other guy I'm sharing my opinion, misinformed as it may be.
- jacobolus 10y agoHave you considered that there could be use cases where the performance gains are not trivial? For some code, we’re talking about more than an order of magnitude speed difference. What kind of language target would you prefer for running optimized numerical algorithms? Or do you just think we should keep computational photography, natural language processing, physics simulation, 3d graphics rendering, game AIs, etc. off the web? Remember, to make their code run at full speed, developers need the ability to use a variety of numeric types and processor-specific instructions (e.g. SIMD), implement low level data structures, precisely manage memory, etc. Even if these numerical algorithms get written in “plain” Javascript, after being minified they become essentially unreadable. Often to understand even an extremely clearly written implementation full of nice explanatory comments requires reading the technical paper alongside the code. If you’re not only missing the paper, but also have nonsense variable names and no comments, deciphering the code becomes an incredible chore. As such, I don’t think WebAssembly will have any significant effect on readability. Have you tried reading and understanding asm.js output from Emscripten? That’s what we have today, and it’s definitely worse than wasm.