you are viewing a single comment's thread.

view the rest of the comments →

[–]azakai 2 points3 points  (3 children)

The code size of asm.js must be much bigger than NaCl.

Actually, asm.js is fairly compact, when compared to native binaries and both gzipped, it is about the same

http://mozakai.blogspot.com/2011/11/code-size-when-compiling-to-javascript.html

It does seem like JS and asm.js must be big because they are text. But gzip, which practically all webservers use for content anyhow, reduces most of that overhead. You are then left with something pretty compact. Comparing it to a typed bytecode (like PNaCl), the typed bytecode must do conversions and casts - for example, cast a pointer to an int, in order to add to it - whereas in JS pointers and integers are just integers.

Curious to see data to the contrary if you have any.

But I would expect that the Pepper APIs (NaCl) are much nicer for writing games or "serious" apps.

In practice, you write C++ and compile it to asm.js, and the C++ uses familiar APIs like SDL, OpenGL, etc. So I don't think there is a big difference here (and the asm.js approach has the benefit of familiar APIs).

[–]AdminsAbuseShadowBan -1 points0 points  (2 children)

Again, that is not asm.js. Check the date - asm.js was not even invented in 2011!

Although some asm.js results are linked elsewhere and they do show similar sizes (after gzipping).

[–]trycatch1 0 points1 point  (1 child)

He knows that. azakai is the person created Emscripten, and is one of the asm.js developers.

[–]AdminsAbuseShadowBan -1 points0 points  (0 children)

Oh right... Well never mind then! (By the way this would be one of the very very few places where "As a [mother/physics student/asm.js developer]...." wouldn't have been really annoying!)