News for hackers. Stuff that matters.
Re:Web Assembly by dccoolgai on Monday November 09, 2015 @07:02PM (#10536721)
With the adoption of wasm, won't the web become inherently less hackable? Right now i can pretty-print some minified js and at least have a basic idea of what APIs are getting called. Difficult to see how one could do the same with wasm. Not saying wasm is a bad idea (i think it's good), I'm just concerned about what this will look like in terms of keeping the nuts and bolts of the web semi-readable.
Re:Web Assembly by s3th on Monday November 09, 2015 @07:26PM (#10536827)
It's definitely a goal to make sure that wasm is as readable as possible. The binary format will be able to be "pretty-printed" into a textual format [0]. We haven't finalized the exact format yet, but it will be much more readable than current asm.js javascript [1].

[0]: https://github.com/WebAssembly/design/blob/master/TextFormat... [1]: https://twitter.com/BrendanEich/status/643828456631857152

(Disclaimer: I'm a Google Chrome PM contributing to the WebAssembly project)

Re:Web Assembly by hn1234 on Monday November 09, 2015 @08:09PM (#10536984)
Seth, the wasm "Text Format" doc at [1] says one of its purposes is "Presentation in browser development tools when source maps aren't present (which is necessarily the case with the Minimum Viable Product (MVP))" and that "Debuggers and profilers will present binary code using this textual format."

However, bugs like [2] suggest to me that the Chrome and Firefox teams do not place an especially high priority on readability and debuggability with source maps in plain old JavaScript. Basically, it's impossible to use Chrome Devtools to see original variable names from the source file (e.g. 'jquery.js') instead of the minified file (e.g. 'jquery.min.js') mapped by the source-map file. This essentially makes source maps useless for debugging complex code and has been a known issue for almost two years.

The most recent comment in that ticket notes work is blocked until a new version of the sourcemap spec is shipped, but the linked resources indicate there hasn't been any public activity on them in three weeks with the Sterland proposal [3] and three months with the Fitzgerald proposal [4].

If keeping the web open source is indeed a priority of Google and Mozilla, then why haven't more resources been allocated to develop those specifications?

In brief, the lack of urgency for bugs like [2] suggests to me that Google and Mozilla don't take "The JavaScript Trip" described by Stallman [5] seriously. I fear that wasm could make it much worse.

-

1. https://github.com/WebAssembly/design/blob/master/TextFormat...

2. https://code.google.com/p/chromium/issues/detail?id=327092

3. https://gist.github.com/asterland/edf028ed7947c8c258d1

4. https://github.com/fitzgen/source-map-rfc/blob/scopes-and-bi...

5. http://www.gnu.org/philosophy/javascript-trap.en.html

Re:Web Assembly by s3th on Monday November 09, 2015 @08:26PM (#10537046)
It's easy to overlook bugs in a tracker the size of Chromium's--even important ones. Thanks for raising the issue again.
Re:Web Assembly by pdkl95 on Monday November 09, 2015 @07:56PM (#10536941)
The existence of a "readable" parse tree doesn't provide the same level of "hackability" or openness as a DOM. You're comparing it to asm.js, but that isn't particularly relevant as asm.js that widely used (emscripten is cool, but the lack of readability you mentioned is a barrier to wider adoption in the general case).

WebAssembly will impact a lot more than just the pages currently using asm.js, and I fear it will introduce the Halting Problem in to a lot more areas. The concern isn't asm.js - it's frameworks like angular (no-content-without-js websites are already a problem). The availability of a parse tree doesn't help if I have to run it to access the structure that is current available in the DOM. With the current drama over adblopcking, I expect advertisers will jump at a technology that lets them treat clients as something they control. (compile an obfuscated version of freetype into small WebAssembly download will be be the key features).

Re:Web Assembly by reissbaker on Monday November 09, 2015 @09:27PM (#10537241)
This is uneducated FUD.

WASM doesn't "introduce the Halting Problem" — I'm not sure how you could even think that was possible. JS is already a Turing-complete language, as are C and C++ (the most common compile-to-asm.js-languages), and the Halting Problem already affects them as much as it affects all Turing-complete languages; the way web browsers "solve" the Halting Problem is that if a script takes too long to run, it's killed. There's no reason that would be any different with a faster-to-parse and smaller-in-bytesize compilation target, which is all that WASM is.

If "the concern isn't asm.js — it's frameworks like angular," then — what? Angular already exists, and is written in regular JS. No new compilation target needed.

And in regards to ad-blocking: what? Ad-blocking works by not running (or loading) content from specific, known advertising networks. That would work regardless of whether the content was written in WASM or asm.js or regular JS or anything else. Just block the network requests and you're done.

Re:Web Assembly by tsenior on Monday November 09, 2015 @10:42PM (#10537488)
Maybe they were referring to embedding the advertisers code into the code base itself without network calls? But I still don't see how this is any different than current sites that serve ad content through their own servers.
Re:Web Assembly by jasode on Tuesday November 10, 2015 @01:40AM (#10537927)
pdkl95 has brought this up before[1] and again, it looks like everyone is confused by his (mis)understanding of: WebAssembly, The Halting Problem, and the economics+friction of practical advertising delivery (now and in the future.)

I couldn't convince him/her that any future trends towards pre-built ads rendered on server proxies, or seamless "native advertising", is orthogonal to WebAssembly.

[1]https://news.ycombinator.com/item?id=10211050

Re:Web Assembly by userbinator on Monday November 09, 2015 @10:35PM (#10537464)
Just block the network requests and you're done.

Not if the ad scripts are mixed in with the content-rendering scripts, in which case you'll need to do some on-the-fly modifying of scripts. Host-level blocking still works for ads served from exclusive servers, but a lot of them are starting to realise that it's so easy to block and are resorting to more subtle methods.

That said, a new type of adblocker based on pattern-matching against a JS syntax tree would be pretty useful.

Re:Web Assembly by iamsohungry on Tuesday November 10, 2015 @12:56AM (#10537833)
> Not if the ad scripts are mixed in with the content-rendering scripts, in which case you'll need to do some on-the-fly modifying of scripts.

This is true, but it's not problem unique to WASM. In fact, your proposed pattern matching AdBlocker seems like it would be much easier to produce targeting WASM.

It's also worth nothing what an edge case this is. Some sites might do this, but large enough sites to be worth doing this will likely be large enough to inspire site-specific workarounds. Smaller sites will be unlikely to couple their ads to their rendering so tightly.

Re:Web Assembly by cwyers on Monday November 09, 2015 @10:05PM (#10537373)
> The existence of a "readable" parse tree doesn't provide the same level of "hackability" or openness as a DOM.

Um, the DOM will still exist.

Re:Web Assembly by AgentME on Monday November 09, 2015 @11:34PM (#10537633)
WebAssembly is just a new storage format for asm.js, which is just a javascript subset. It doesn't replace the DOM. That still exists just as it does with Javascript! Any openness problems that exist with WebAssembly already exist with minified Javascript.
Re:Web Assembly by shams93 on Monday November 09, 2015 @11:41PM (#10537646)
That's not really the use case for it, the use case for Web Assembly is to take web audio and turn it from being a kind of toy into a platform where an ableton live could be empowered to run in the browser, as well as being able to load native plugins for audio processing and generation. Also say you want to transcode a video file from webm to hls, with web assembly that becomes possible, even with asm.js its really brutally slow to try to do that.
Re:Web Assembly by iamsohungry on Tuesday November 10, 2015 @12:52AM (#10537822)
> and I fear it will introduce the Halting Problem in to a lot more areas.

This is the part of your post where I concluded that you were deeply confused and stopped reading. The didactic part of me wants to teach you what the halting problem is, but I'm not even sure what it is you don't know at this point.

Re:Web Assembly by placeybordeaux on Monday November 09, 2015 @08:31PM (#10537056)
Why are you concered that it will "introduce the Halting Problem in to a lot more areas."?
Re:Web Assembly by andrewchambers on Monday November 09, 2015 @08:49PM (#10537114)
All this is already done with asm.js and emscripten.
Re:Web Assembly by eosrei on Monday November 09, 2015 @07:41PM (#10536884)
You'll be able to reverse engineer. Interpreting JS is a massive waste of CPU/battery for the majority of users. The savings is worth a slight increase in complexity for developers.
Re:Web Assembly by pdkl95 on Monday November 09, 2015 @08:20PM (#10537025)
The solution to high CPU/battery usage is to send a static page. Invoking a new type of VM may help slightly, but it probably just moves the problem around.
Re:Web Assembly by sp332 on Tuesday November 10, 2015 @07:44AM (#10538957)
There's no reason to limit the web to static pages. How would you do this with a static page https://benedikt-bitterli.me/tantalum/tantalum.html ? Or http://www.nytimes.com/interactive/2015/05/03/upshot/the-bes... Or https://play.freeciv.org/ Or anything on this page http://www.kongregate.com/ or, you know, Facebook or Twitter or Google Maps/Books/Docs/Photos...?
Re:Web Assembly by Ace17 on Tuesday November 10, 2015 @12:26AM (#10537761)
A static page ? What about games? Are you advocating to go back to Adobe Flash?
Re:Web Assembly by alimbada on Tuesday November 10, 2015 @05:27AM (#10538523)
Why does it need to be semi-readable? Why does it need to be readable at all?
Re:Web Assembly by pjmlp on Tuesday November 10, 2015 @04:54AM (#10538432)
For sure one will come up with nm or dumpbin for wasm, if they really want to.