Hacker News new | ask | show | jobs
by modeless 3841 days ago
Web assembly doesn't add new APIs or capabilities to the web platform. It only makes code run faster and makes porting C++ code easier. What about that is hateful or abusive?
2 comments

That now we can’t read the source of webpages at all anymore?

The whole "anyone can look at it, learn from it" part is gone?

We’re steering towards more proprietary code.

Say, for example, if I want to run Google’s "Star Wars" easter egg in Firefox. With JS, I could grep through the de-uglified and de-obfuscated code quickly, and find that its useragent detection would work if I’d just append "AppleWebKit Chrome/45.0.0.0." to the UserAgent. With WebAssembly, I’d have to spend far more work.

You can't read the obfuscated code directly. You have to use tools to deobfuscate it. With Web Assembly it will be the same. There will be tools to help you read the code. You may proclaim that they won't work as well but I think it's premature to say that. Web Assembly is not machine code.
Web assembly is very generic byte code.

I fear I’d end up spending ages in IDA breaking a DRM scheme implemented in WebAssembly, just like I did with NaCl.

That’s not neat.

Sorry, my intent was not to imply that web assembly was hateful or abusive but that the code I might write using it falls into two categories

1. Performance critical code 2. Sneaky stuff I really don't want the user to be able to read.

Category two seems like the sort of thing that I would absolutely want to be able to write binary code that executes without user interaction.

It seems like right now the focus is quite rightly on #1, but that #2 seems like it will inevitably become an issue.

> 2. Sneaky stuff I really don't want the user to be able to read.

The user is already going to have a hard time reading the unuglified JS. If they are looking for "phoning home" they have to search for WebSocket sends and ajax calls. Both of those will have well defined APIs that will be just as easy to spot in dissembled webasm as they are in unuglified JS. I bet they'll be even easier to spot.

You're missing category 3: Code that runs in more than a browser. If I have code written in Fortran that already solves my problem, why should I have to rewrite it? If I'm more comfortable in C#, why should I be forced to use Javascript for writing front-end code? WebAssembly fixes the mistake that the web should be a monoculture, and allows people to use the best language for the job.
3. Any other code written in a language better than JS.