by dccoolgai · 10y ago · 0 comments
Sorry for the snark, but watching this slow-motion trainwreck plow into the Open Web that I love is excruciating.
Pre-edit to respond to the inevitable "But you already can't read and debug minified JS": yeah, you actually can if you're good enough. I do it all the time... my complaint is that the bar for "good enough" is being moved from "can read and debug scripting language" to "can read and debug Assembly"... which I know you can do, but geez. I guess what I'm saying is the Open Web should only run on (reasonably) readable languages. Hate JS? Stand in line, but if you want to replace it on the web, replace it with something a normal person could interpret without a compiler.
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
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
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.
I'm sorry, and with all due respect, your argument is hilarious, NIMBY, and goes against the Open Web movement's goal of "...a special role for public, cooperative, and standard World Wide Web communications", which you claim to love, and I assume, support (as do I). Wasm has a required text format in the spec itself, expressly for individuals such as yourself, so wasm is still for the Open Web.
How about "but you already can't read and debug minified Emscripten output"?
That being said, as there are already many languages that compile down to non-human-readable javascript (Including C), it's fairly moot at this point anyway.
Although I can't disagree that debugging js directly in browser tools is a nice experience.
Even if you "do it all the time" there's like zero motive to do it for third party sites and services.
Does anyone (for the statistically significant meaning of "anyone", e.g. more than some lone outliers) seriously debugs and/or monkeypatches third party sites?
And of course for your own site, you already have the code.
So I'm not sure what you're losing here.
What would you like to see happen here? Maybe you should give them your input.
I'm so lost, why on earth are you reading binaries? You keep citing examples of cleaning up after other people for a job. Why don't you have their source code?
If your job was with any other language, you would have the source code - you would not be given a Go binary and told to "fix what those previous morons did" - you would demand the source.
Are you saying that you are frequently given minified javascript off of some website and that the previous workers left with the source code?
As for "I'm so lost, why on earth are you reading binaries?"
Consider every Perl/Haskell`/Smalltalk/COBOL developer for a moment. Do you think it's more likely that when this becomes a production standard they are going to say to themselves "You know what, I feel bad for the guys that will have to maintain this I'm just going to learn JS so at least it can be maintained in the same language the rest of the web is"... because I think it's probably more likely that they will immediately start transpiling binaries from COBOL etc, into WASM to run the web. Great for them, really but that's what leaves us with binaries to deal with.