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.
This isn't conducive to a civil discussion on the subject. Please don't.
I mostly write C and C++ code, and if someone tries to give me hand-written assembly they better have a good reason (and sometimes they do!). Same goes for wasm: it's meant as a compiler target, not something humans write by hand. That's no different from all the compile-to-JS languages, asm.js, or any assembly.
Sure Joe Schmuck can still get stuck with angry assembly, but we haven't made the world a worst place in that respect.
And I'd argue wasm is making the world better in many other ways. :-)
If some company works with C# making GUI apps and then leaves on a deal, and the only thing left is a binary of the app.. no source code.. no sane person is going to touch that. Same thing for WASM.
Though, there is a text spec, but ignoring that of course.
Even for an "open web", if the OP's argument is that many individuals are leaving without source code, and all he/she is left with is to copy the minified javascript from the page and abstract meaning from that non-commented non-formatted and non-named code.. holy hell, i would not want to have OPs job. Especially if that is a common occurrence.
Give me the source code. I don't care if it's C or Javascript or HTML. Is this unreasonable?
It has a culture of people viewing source and tinkering. Minification etc. limit that, but do not eliminate it.
And the web is a medium for transmitting and running other people's code on your machine in a safe way, and that includes not just sandboxing but also being able to inspect it.
It's important that the wasm text format be as readable as possible, to continue these traditions, even if wasm is a compiler target.
Back on earth though, all those things don't make sense, and are so rare as to be statistically insignificant.
In any case, not a valid argument to make against a new language/delivery format, any more than "what if someone drops it off some building and kills passers by" is an argument against pianos.
>If nothing like that ever happened to you... well I hope it never does, friend.
And if something like that ever happened to you, then maybe consider it an outlier experience, and don't extrapolate on that?
It's like an airplane accident survivor going on about how flights should be banned.
Yeah, hardly a real world use case.
And if a company ever has it, this would point that they have far bigger problems than being left without the source code for their service...
Why would you not have the source code to your site that you're debugging?
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.
https://youtu.be/RByPdCN1RQ4?t=1714
And from their FAQ:
>Will WebAssembly support View Source on the Web?
>a specific goal of the text format is to allow developers to write WebAssembly modules by hand for testing, experimenting, optimizing, learning and teaching purposes. In fact, by dropping all the coercions required by asm.js validation, the WebAssembly text format should be much more natural to read and write than asm.js.
https://github.com/WebAssembly/design/blob/master/FAQ.md#wil...
Now I didn't mean to come off as snippy and for that I do apologize, but I find it frustrating when people attack a project without understanding what it is they're criticizing. If you had asked "Does this pose a threat to the open web?", I think this would have been a much more productive exchange.
If you succeed in derailing Web Assembly, then you'll just have people shipping Emscripten output, and "View Source" will be worse off.
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.
Now, about having other languages compiled to the web, we already have that. Looking at specifically Haskell, we have GHCJS, and it (thankfully) works pretty well.
You may not like the idea that there will be new web projects using technologies that you lack proficiency in, but this is no different then how the rest of the software world works. For example, Google's Go language is picking up steam - in fact, I use it at work. If I didn't take the time to learn Go, I simply wouldn't be employed to work on that project. Similarly, I know people who are enjoying an incredible competitive advantage in their market by using Haskell for their web development (both backend with GHC and front end with GHCJS). If you don't learn Haskell, you won't be hired for those jobs. I do, however, guarantee that they'll still have the source on hand.
> You keep citing examples of cleaning up after other people for a job. Why don't you have their source code?
If you were working in C/Java/etc I'm sure your first reaction to the same problem wouldn't be "C is broken because I can't debug a compiled executable easily!".
It's a long list: https://github.com/jashkenas/coffeescript/wiki/list-of-langu...
Also, ultimately, there will be code that you can't maintain because you don't understand it. That might be because it's written in a language you don't know, but it might also be because it's written in a style you don't understand, or with a framework you've never used, or because it's about a topic that you haven't spent time with. That's OK. You don't need to be able to do everything.
Also - thanks for taking the time to make a thoughtful reply instead of just suggesting I'm a complete ignoramus and downblasting my response because we have a marginal disagreement about the Open Web Platform - made my day!
Right now, if you are a frontend "web developer", you can pretty much assert what you know from the title alone. The title implies the toolset.
In ~5 years? It means.. what, HTML/CSS, and whatever language you prefer? Rust? C++? Python? JavaScript? An endless array of frameworks in a sea of different languages?
I mean, it's no different than most other development in that regard.. but the web certainly will go through a change when this day comes.
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.