8 ms·
I can't wait until the first time I have to maintain something someone compiled into this monstrosity. The minimal performance gains will be so worth destroyin
by dccoolgai 10y ago
I can't wait until the first time I have to maintain something someone compiled into this monstrosity. The minimal performance gains will be so worth destroying the debuggable web.
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.
- kevinwang 10y agoWould this be any different than debugging code currently written in a language that compiles to asm? For example, people debug C code, compiled to asm, on their computers. Would it be different to debug C code, compiled to webassembly, in a browser? Although I can't disagree that debugging js directly in browser tools is a nice experience.
- dccoolgai 10y agoPretend you don't have the C code, though - only the WASM binary... because I know it's hard for all of the Rockstartup Cowboys on HN to imagine being a quotidian schmuck like me... I am the guy - like probably most devs - who comes in after the Rockstar hangover to clean up and maintain the mess. Pretend the relationship with the initial developers went sour (as is often the case)... and you're left with this steaming pile of binary WASM. Now what? Seems like these guys making WASM never thought of me or the others in the silent majority of "poor schmucks" ..or just wrote that off entirely with a modicum of lip service in the form of "but we'll have a text version of Assembly you can burn your eyes with" and that's what I find so troubling about the whole thing. Now I have to learn how to read and debug assembly (which I did in College...but honestly, man).
- todd3834 10y agoIn this scenario you are going to have to maintain the binary code without having the original source code that generated it? My understanding is that you would maintain the cleaner non binary version, am I understanding this wrong?
- corysama 10y agoI'm having a hard time following your example. Relating it back to traditional web dev, it sounds like you've experienced developers leaving your team, taking the original JS/Coffeescript/whatever source with them and leaving you with the Closure Compiler minified JS to move forward with the project. Is that something that actually happens? That sounds like grounds for an IP lawsuit. Because that's equivalent to what you are describing in your WASM hangover example.
- dccoolgai 10y agoSometimes you don't even want the Coffeescript after you look at it... sometimes it's a friend of a friend and it should be a lawsuit, but they don't have the money or time and they just need someone to unscrew their situation as best and quickly as possible. If nothing like that ever happened to you... well I hope it never does, friend.
- coldtea 10y agoYeah, and sometimes a dog eats your homework. 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.
- jfbastien 10y agoWe're quotidian schmucks as well. We've thought about you :) 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. :-)
- joshkpeterson 10y ago"Open and debuggable: WebAssembly is designed to be pretty-printed in a textual format for debugging, testing, experimenting, optimizing, learning, teaching, and writing programs by hand. The textual format will be used when viewing the source of wasm modules on the web."[1] What would you like to see happen here? Maybe you should give them your input. 1. https://webassembly.github.io/ https://webassembly.github.io/
- dccoolgai 10y agoIt's Assembly, hombre. In my class of like 40 kids in college I remember one who really like to read and code in that. Maybe you are that guy - and more power to you... but the web has to work for the other 39 of us. That's what WASM is taking away IMHO.
- Klathmon 10y agoDo a little reading about the wasm text format. It's not assembly, its meant to be read by JavaScript developers.
- fizzbatter 10y agoFirst off, sorry for the downvotes. Your opinion is unpopular, but it breeds discussion. Now.. 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?
- dccoolgai 10y agoFirst, no worries. If I have karma, there is no better way to spend it than advocating for a more maintainable Open Web in my opinion. 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.
- JasonSage 10y agoThis 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.
- diamondlovesyou 10y agoAsm.js is hardly human readable; which is rather the point (not sure why this is so highly coveted, since we use source code for this purpose and the minification counter argument is nonetheless true just as it is for Wasm, but I digress). And you can debug text wasm, if you're good enough. 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.
- deleted 10y ago[deleted]
- SquareWheel 10y agoA text format will be delivered alongside the binary for debugging. It will be exactly as debuggable as Javascript is (very). Please research the subject before posting kneejerk reactions.
- dccoolgai 10y agoPlease read their text-transpiled version - because I did, thank you - and come back here and reply to this thread that you'd rather work in that than a readable scripting language. I'll be waiting here to upvote you and tell you you're better than me.
- SquareWheel 10y agoYou mean the temporary S-Expression syntax? Because that's not how the final version will look. https://youtu.be/RByPdCN1RQ4?t=1714 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#will-webassembly-support-view-source-on-the-web 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.
- pcwalton 10y agoA lot better than Emscripten output, which people are using today. If you succeed in derailing Web Assembly, then you'll just have people shipping Emscripten output, and "View Source" will be worse off.
- dekimir 10y agoThere is an effort under way to ensure wasm debugging is at least as easy as JS debugging: https://github.com/WebAssembly/design/pull/708 https://github.com/WebAssembly/design/pull/708
- pcwalton 10y ago> But you already can't read and debug minified JS How about "but you already can't read and debug minified Emscripten output"?
- kowdermeister 10y agoMany years ago I added a feature (image upload button) to a minified WYSIWYG editor code without prettifying it :)
- aidenn0 10y agoAnd I know someone who modified the MS MPEG-4 Version 3 codec to use SIMD instructions for the RGB/YUV colorspace transform, which both sped up and improved the accuracy of it. We can all agree that source-code is more readable than binary code though. 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.
- kin 10y agoThe performance gains are going to be massive. All of the browsers collectively demo'd this: https://webassembly.github.io/demo/ https://webassembly.github.io/demo/
- randyrand 10y agoWebassmebly is just as debuggable as minified JS. So what are you on about?
- justinpombrio 10y agoThere's something fishy about this argument... why doesn't it apply to the desktop? Would it be better if all desktop software was written in JavaScript, enabling debuggability in exchange for performance?
- aidenn0 10y agoAt that point you might have something like the lisp machines. I've not used one, but have heard more than one person talk about the very good debugging experience on them.
- coldtea 10y ago>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... 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.