Hacker News new | ask | show | jobs
by dccoolgai 3316 days 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 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.
10 comments

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.

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

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

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

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

I NEED THE FLV FILE NOT THE SWF
You mean the .fla ;)
Downloading youtube videos has ruined me.
Ha.
Isn'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?
You can translate it to something human readable(ish): https://github.com/WebAssembly/wabt
Really? Go to google or Facebook and tell me any of that source is readable. :)
The 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.

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

They are using React as a replacement for something like Jquery or Angular. If they kept it in house, they would slowly drift away from the rest of the development community. They only open sourced React in order to benefit from the work of other developers and prevent someone else from copying it and having those resources go into an incompatible de-facto fork.

They certainly didn't do it because they see a path from "Typical Facebook User" to "React User". They see typical Facebook users as consumers of services, incapable of understanding software in a deep way.

And they see them that way because they are supremacists. I don't think this assertion is overblown at all. I wish more programmers would just admit that they are supremacists, then we could get on with talking about whether that's a problem or not.

>They are using React as a replacement for something like Jquery or Angular

How about the fact that it is just flat-out superior? Do you really disregard the tool entirely simply because there are alternatives? React is amazing. I am guessing you don't think much of front-end development?

>They see typical Facebook users as consumers

Who is "they"? Every single person at Facebook? I think you are painting with a broad brush. People work at businesses; they don't follow the party line of said business.

>I wish more programmers would just admit they are supremacists

What is your point? That people who have written enough code that they are capable of developing software think they are more knowledgeable about software than people who haven't written enough code to be capable of developing software?

What about this makes a software engineer a supremacist vs. a mechanic, a scientist, a mechanical engineer, a ....

As an aside, jQuery isn't really comparable to React or Angular. They do entirely different things.
You've got the timeline precisely backwards here. The move towards making computing less and less like a motorcycle and more and more like a train was _not_ pioneered by companies like Google: they were the ones fighting it kicking and screaming for years. The market demanded that things get less and less hackable and more and more shiny, or at the very least rewarded those (like Apple) that felt that way too.
You guys don't need to come to the defense of Facebook and Google. This shouldn't be about blame. The point is that there's a problem. We need to fix it. Let's stop pointing fingers at each other and point them at ourselves.
I think that inaccuracy in and of itself is a problem when it comes to anything worth discussing. Not all of us see the world through such us-vs-them culture-warrior blinders all the time.

The point I was making that the market is demanding it (as opposed to companies pushing it on users) is entirely material to the discussion.

I think the desire for a closed web is driven much more by the need for a days wages than some overblown sense of superiority to others.

If you disagree, why not spend a day talking to one of those engineers? I'm one. My friends are others. We're mostly nice people, with hardly a sense of superiority at all!

So you are afraid someone could learn and be inspired by your code ? And that would not be an advantage to you ?
Yeah 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.
You'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.
Did you ever try to decompile your iOS or Android app to learn from them. As a mobile developer, I never learn things this way.
That'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.
The 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/

EDIT: looks like this [2] can convert between binary and textual format.

[2] https://github.com/WebAssembly/spec/tree/master/interpreter/