7 ms·
This represents simultaneously everything that makes me hopeful about WASM - a really clean, fun and nice game that performs super well - and everything that ma
by dccoolgai 9y ago
This represents simultaneously everything that makes me hopeful about WASM - a really clean, fun and nice game that performs super well - and everything that makes me dread it. I was curious so I opened up https://www.funkykarts.rocks/demo.wasm https://www.funkykarts.rocks/demo.wasm and there's nothing there that I can really read and learn from. I'm not saying it isn't worth making the trade, but it seems like a fundamental change to a part of the web I really loved - the ability to read and learn from things you experience that are cool - that doesn't seem to be considered very much and it makes me a little sad to see its inexorable end spelled out. I think I'll soon miss the days where we all had to show each other our code on the web.
- shurcooL 9y agoDon't you still have that place, for example GitHub, where open source code lives in non-minified, non-obfuscated form, together with a README, an issue tracker, etc.? Why do you need to rely on the production binary to be human readable? Should web developers be forced to open source all their work, whether they want to or not, because of technical limitations of the web implementation? > I think I'll soon miss the days where we all had to show each other our code on the web. All of my code is open source, you're welcome to look at it. That's not changing because WebAssembly is coming out.
- nathcd 9y ago> Should web developers be forced to open source all their work, whether they want to or not Yes - that's how the web works (barring obfuscation/minificaction). And it's how wasm will work too: http://webassembly.org/docs/text-format/ http://webassembly.org/docs/text-format/.
- dccoolgai 9y ago"Should web developers be forced to open source all their work, whether they want to or not" Yes. If they want it to run on the Web. That's the way it currently is and that's the thing I'm saying I'll miss. You don't have to put any of your code on the Web, but when you do I can read it. I like that.
- tribby 9y agoI appreciate the nostalgia and share the sentiment, but it's mostly gone from the web already thanks to JS minification and asset minification in general. without a repo to look at the original code, it won't be of much use, even using devtools. you can figure it out a lot more quickly than analyzing a binary, sure, but the web isn't a "hey what's this how does this work" platform anymore, unfortunately.
- hacker_9 9y agoYeah I feel like the OP missed the last 10 years or something, unreadable minified code is everywhere.
- dccoolgai 9y agoI read it well enough to see where the .wasm source was coming from. The demo.wasm is inscrutable to me where the JS around it is not. I realize not everyone is at a level where they can debug/read JS, but I can assure you it's possible to do as a person of only modest intellect. Source: I can do it, and I am a person of modest intellect. I can't really see a "path forward" doing the same thing with .wasm, even decompiled to s-expressions.
- evocatus 9y agoIn my experience a lot of JavaScript code is already unreadable after having passed through minification & concatenation. Even more so with webpack bundles. Now granted, ASCII is still much easier to read than a binary, but I think we've already moved past the era of easily readable website source code.
- camoby 9y ago"In my experience a lot of JavaScript code is already unreadable after having passed through minification" I think that's the point. Obfuscation. All minified code is easily de-minified if you want to know how it works (and can understand the language)
- bluetwo 9y agoYes, a throw-back to the days of Flash in some ways. "Can you update these files?" "Sure, can you give me the source code?" "I gave you the source code." "No you didn't. I can't edit these." "Well it's all I've got."
- hackcasual 9y agoIn some cases its due to how new WASM is and the fact that nothing beyond a bare bones debugger experience was considered needed for the MVP. I'm not sure WASM is worse than the general state of web source availability. At least strict typing gives more hints about the underlying code in a disassembly. That said, WASM may make things better in the future at least when it comes true open source. It's a pretty clean output target, making things like verified builds a possible extension. Once better debugging support lands, sites can opt in to providing fully mapped output->source code as part of the debug metadata allowing a functional view source.
- SquareWheel 9y agoGood information, thanks. I was hoping that mapping data would be an inherit trait of WebAssembly, as I too prefer how open source frontend languages are. I'm very excited for WebAssembly, but I would hate to lose the ability to easily dissect what's running on our machines. Even with minification this is still somewhat possible. At the very least, I hope browser vendors improve dev tools for reading wasm files in the future.
- nathcd 9y agoThe text format (.wast/.wat) should be derivable from the source (though I've no idea how to do this). From [1]: > The design goals for a WebAssembly text format derive from the following use cases: > View Source on a WebAssembly module, thus fitting into the Web (where every source can be viewed) in a natural way. [1] http://webassembly.org/docs/text-format/ http://webassembly.org/docs/text-format/ EDIT: looks like this [2] can convert between binary and textual format. [2] https://github.com/WebAssembly/spec/tree/master/interpreter/ https://github.com/WebAssembly/spec/tree/master/interpreter/
- akavel 9y agoIsn't readability already killed by minifiers? Not sure what's the status on the wide web, but I know at least at my employer we're using them, and it sounds they're something popular and well established?
- johnfn 9y agoReally? Go to google or Facebook and tell me any of that source is readable. :)
- erikpukinskis 9y agoThe fact that so much of the web is closed source now is a great tragedy, and is the result of the fact that those companies primarily see themselves not as software vendors, but as service vendors. They see humans as a kind of zoo animal who isn't really capable of engaging deeply with their software products, and can only jab at buttons. If Google and Facebook weren't run by supremacists, and instead considered the general public as intelligent beings who are capable of understanding software, we might see more software coming out of those walled gardens. But they don't. Facebook and Google "engineers" (and software "engineers" at large) think of software as fundamentally hard, fundamentally technical, fundamentally something for the precious few with brains big enough to engage with it deeply. It's just like books used to be, when the educated considered reading too advanced for the unwashed masses. And so these service companies toss apps over the wall for the plebs to play with, and they keep all the cool toys for themselves. There are some exceptions. They open source some commodity tools, but only where there is open source competition forcing them to do so. I find it quite sad. But they'll lose when the web comes roaring back, when some IDE learns to operate within the language of the plebs, and the plebs learn to code, the wizards at Facebook and Google will find out what happens when you treat your customers like they are too stupid to operate at your level. Silicon Valley runs on supremacism. Supremacism breeds resentment. Bumpy roads ahead. Some people at Google seem to understand this. I see them fighting for an alternate worldview. Maybe when the change happens, that minority will gain control of the company.
- nawgszy 9y agoThis seems... maybe a little overblown. I mean, considering I program in React every day, I find this characterization of Facebook's engineers maybe a little insulting. They seem to be perfectly aware their tools are usable by others, and probably went out of their way to make them as usable as possible by others. Anyways, whatever, my two cents are a lot less passionate than yours, so carry on.
- meheleventyone 9y agoYou can translate it to something human readable(ish): https://github.com/WebAssembly/wabt https://github.com/WebAssembly/wabt
- shams93 9y agoYeah when I use webpack all you can see is all the code compressed into one line, about as helpful as reading binary, its really a matter of sharing the source code, most mobile users which are the majority can't even view source anymore. That aspect of the web is dying due to things like webpack and webassembly, but github offers a better alternative than "view source" these days.
- db48x 9y agoYou'll have the same problem with minified JS too. If your browser's dev tools don't clean it up for you then you need a better browser. Obviously everyone _should_ be using source maps, but you can't rely on that.
- snipethunder 9y agoDid you ever try to decompile your iOS or Android app to learn from them. As a mobile developer, I never learn things this way.
- dccoolgai 9y agoThat's the point. The web, at least until now, only ran a mostly human-readable scripting language. Even if grokking the entirety of a codebase isn't easy because of minification, you can still see basic loop structures, API calss, etc.