Hacker News new | ask | show | jobs
by shurcooL 3316 days ago
Don'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.

2 comments

"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.

I 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.
Yeah I feel like the OP missed the last 10 years or something, unreadable minified code is everywhere.
I 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.
> makes me dread it

What you're experiencing here is a lot more equivalent to someone putting up an HTML page that contains links to .exe binaries to run a 3D game. Except with WebAssembly, you get to skip the downloading .exe and executing it in a safe sandbox steps.

The .exe binary wasn't open source before, and it isn't now.

So I don't see why WebAssembly is causing feelings of dread for you.

In 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.
"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)

Absolutely true.

The point I was trying to make is that the days of yore OP was alluding to where when I "put any of [my] code on the Web, [...] I can read it" are long gone, thanks to the obfuscation of modern bundling technologies.

By the same logic, all compiled code (including WebAssembly) is easily reverse engineered if you want to know how it works.

> 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/.