Live data from Hacker News

Assembling WebAssembly

webkit.org

41–50 of 91 posts

Re: Assembling WebAssembly

#41
post #39
post #20

Earlier quoted context omitted.

As I understand it, potential performance gains are higher than 2x, and we're still in a pretty early stage. It depends on your application. Also, as has been mentioned by others, WebAssembly could perhaps evolve to take a greater role, leading to a greater potential impact of performance gains. Finally, if the complexity does in fact outweigh the benefit, the idea would eventually fade away. So far it looks promisin…

Where does even the 2x come from? Currently it looks very much like 1x vs integer hinted JS code like generated by asm.js.

That is incorrect. See: https://github.com/WebAssembly/spec/blob/master/papers/pldi2...

These are already old numbers, and section 7.3 says 33.7% more efficient. Were one to run updated numbers, and use more than Chrome and Firefox, I'm pretty sure the numbers would be better still.

Re: Assembling WebAssembly

#42

Earlier quoted context omitted.

> I've seen numerous discussions about integrating WebAssembly with the JavaScript heap. That might not require full GC; ownership semantics might suffice (such that either wasm or JS can own the object at any given time, and within the wasm world it can use wasm memory management). Those discussions have not resulted in a proposal. Ownership semantics are most likely not going to work. The options being considered a…

> So long as this is the pattern, WebAssembly will necessarily take longer to load than JS because the same program written in wasm will be bigger than its JS variant. Binary bytecode, which is what webassembly apps are, is often, generally, almost always smaller than source code. Except for really small programs. Also, js code needs to be parsed previously. Webassembly code does not. Webassembly should load faster a…

I think you're misunderstanding Fil's point: JS is more expressive, and can often encode more things in a smaller package.

For same-code wasm / asm.js / x86 comparison (not what Fil was talking about) see section 7.3: https://github.com/WebAssembly/spec/blob/master/papers/pldi2...

Additionally, WebAssembly definitely needs to be parsed. See: https://github.com/WebKit/webkit/blob/master/Source/JavaScri... and https://github.com/WebKit/webkit/blob/master/Source/JavaScri...

Granted, that's simpler than parsing JavaScript.

Re: Assembling WebAssembly

#43
post #39

Earlier quoted context omitted.

Where does even the 2x come from? Currently it looks very much like 1x vs integer hinted JS code like generated by asm.js.

That is incorrect. See: https://github.com/WebAssembly/spec/blob/master/papers/pldi2... These are already old numbers, and section 7.3 says 33.7% more efficient. Were one to run updated numbers, and use more than Chrome and Firefox, I'm pretty sure the numbers would be better still.

Very interesting looking paper, thanks.

I note that the comment in 7.3 says the biggest speedup vs asm.js is in validation, so I assume this means the measurement includes startup. This advantage is easy to concede to WebAssembly due to its design.

Re: Assembling WebAssembly

#44
post #43

Earlier quoted context omitted.

That is incorrect. See: https://github.com/WebAssembly/spec/blob/master/papers/pldi2... These are already old numbers, and section 7.3 says 33.7% more efficient. Were one to run updated numbers, and use more than Chrome and Firefox, I'm pretty sure the numbers would be better still.

Very interesting looking paper, thanks. I note that the comment in 7.3 says the biggest speedup vs asm.js is in validation, so I assume this means the measurement includes startup. This advantage is easy to concede to WebAssembly due to its design.

FWIW I trust that the numbers were good when the Google and Mozilla folks gathered them, but I had nothing to do with numbers!

In particular, I haven't looked into validation. JSC doesn't treat asm.js any differently than JavaScript, so the comparison would be different as well.

Re: Assembling WebAssembly

#45

Earlier quoted context omitted.

> I've seen numerous discussions about integrating WebAssembly with the JavaScript heap. That might not require full GC; ownership semantics might suffice (such that either wasm or JS can own the object at any given time, and within the wasm world it can use wasm memory management). Those discussions have not resulted in a proposal. Ownership semantics are most likely not going to work. The options being considered a…

> So long as this is the pattern, WebAssembly will necessarily take longer to load than JS because the same program written in wasm will be bigger than its JS variant. Binary bytecode, which is what webassembly apps are, is often, generally, almost always smaller than source code. Except for really small programs. Also, js code needs to be parsed previously. Webassembly code does not. Webassembly should load faster a…

I believe the thought was that, for many languages, there is an additional, standard runtime, which is not always remove-able from the language itself, which may not always be of a trivial size, and which is not guaranteed to be already available on a client machine.

Re: Assembling WebAssembly

#46

I hope wasm becomes the first class citizen and JavaScript becomes just one out of many languages that compiles to it. JavaScript is not bad at the high level, but at the low level it has been hell for engineers to implement a fast VM. A wasm VM is way easier to implement than a JavaScript VM.

I do like the upside, but coupled with DRM support, it's going to be used to obfuscate, hide and control things. I'm expecting a much less open web coming.

Re: Assembling WebAssembly

#47
post #46

I hope wasm becomes the first class citizen and JavaScript becomes just one out of many languages that compiles to it. JavaScript is not bad at the high level, but at the low level it has been hell for engineers to implement a fast VM. A wasm VM is way easier to implement than a JavaScript VM.

I do like the upside, but coupled with DRM support, it's going to be used to obfuscate, hide and control things. I'm expecting a much less open web coming.

WebAssembly is as Turing-complete as JavaScript is, and has fewer APIs. The only API it has JS doesn't really is grow_memory, and even that can kinda be done with ArrayBuffer.

I'm not sure what you think makes it the harbinger of closed web. As the WebAssembly CG chair, I'd be interested in understanding that.

Re: Assembling WebAssembly

#48
post #46

Earlier quoted context omitted.

I do like the upside, but coupled with DRM support, it's going to be used to obfuscate, hide and control things. I'm expecting a much less open web coming.

WebAssembly is as Turing-complete as JavaScript is, and has fewer APIs. The only API it has JS doesn't really is grow_memory, and even that can kinda be done with ArrayBuffer. I'm not sure what you think makes it the harbinger of closed web. As the WebAssembly CG chair, I'd be interested in understanding that.

I don't see it as THE harbinger, but one of many. Some people will use it for the same reasons that they obfuscate things today. See, for example, the dropbox client. It's python, but they go to great lengths to keep you from peeking behind the kimono.

I understand WASM isn't reverse engineering proof, but it certainly raises the bar. Especially sans source maps.

Re: Assembling WebAssembly

#49
post #48

Earlier quoted context omitted.

WebAssembly is as Turing-complete as JavaScript is, and has fewer APIs. The only API it has JS doesn't really is grow_memory, and even that can kinda be done with ArrayBuffer. I'm not sure what you think makes it the harbinger of closed web. As the WebAssembly CG chair, I'd be interested in understanding that.

I don't see it as THE harbinger, but one of many. Some people will use it for the same reasons that they obfuscate things today. See, for example, the dropbox client. It's python, but they go to great lengths to keep you from peeking behind the kimono. I understand WASM isn't reverse engineering proof, but it certainly raises the bar. Especially sans source maps.

Source map is totally optional! It provides zero help in understanding asm.js or minified JS. I see what you're saying about binaries being opaque blobs, but I just don't see how that's different from asm.js or minified JS.

Kinda sounds like you're trolling pcwalton TBH: https://twitter.com/pcwalton/status/872151997473972224

I approve ;-)

Re: Assembling WebAssembly

#50
post #48

Earlier quoted context omitted.

I don't see it as THE harbinger, but one of many. Some people will use it for the same reasons that they obfuscate things today. See, for example, the dropbox client. It's python, but they go to great lengths to keep you from peeking behind the kimono. I understand WASM isn't reverse engineering proof, but it certainly raises the bar. Especially sans source maps.

Source map is totally optional! It provides zero help in understanding asm.js or minified JS. I see what you're saying about binaries being opaque blobs, but I just don't see how that's different from asm.js or minified JS. Kinda sounds like you're trolling pcwalton TBH: https://twitter.com/pcwalton/status/872151997473972224 I approve ;-)

I understand source maps are optional...not getting the exclamation point. That's exactly my point, it's optional and therefore not much help.

Minified js isn't (so far) a barrier for me. Prettify and a short bit of debug clears things up. Chrome even helps[1]. I have not yet run into asm.js used for anything in my field.

[1] https://developers.google.com/web/tools/chrome-devtools/java...

Post reply on HN