News for hackers. Stuff that matters.
Re:Asm.js: a strict subset of js for compilers – working draft by duaneb on Friday February 15, 2013 @03:18PM (#5228329)
> You seem to be very hung up on surface syntax. The importance of a VM is not the syntax of its language but the semantics.

I'm protesting that there is a syntax to this 'VM'. It's rather indicative of Mozilla's approach to life, namely, write everything in JS out of some pseudomasochistic desire for backward compatibility hacks.

I would really, really like to see some benchmarks comparing NaCL vs asm.js, and I won't buy this as a viable compilation target until there's data to back up these (dubious) claims. If they do, then perhaps a frontend would be useful.

> The importance of a VM is not the syntax of its language but the semantics.

The semantics of JS are pretty horrible too.

In short, what appears to be Mozilla's idea for the future: http://i.imgur.com/B5KRsHI.jpg

Re:Asm.js: a strict subset of js for compilers – working draft by chc on Friday February 15, 2013 @03:41PM (#5228508)
> I'm protesting that there is a syntax to this 'VM'.

That isn't a very reasonable thing to protest. Every language has a syntax. That includes every ASM variant. Syntax is an inherent aspect of language. What it sounds like you're actually offended by is that its syntax is very different from most ASM syntaxes.

> The semantics of JS are pretty horrible too.

Are you talking about asm.js, or are you talking about the superset that is not relevant to this discussion?

Re:Asm.js: a strict subset of js for compilers – working draft by azakai on Friday February 15, 2013 @04:18PM (#5228737)
> I would really, really like to see some benchmarks comparing NaCL vs asm.js, and I won't buy this as a viable compilation target until there's data to back up these (dubious) claims.

The current numbers are that asm.js is around 2x slower than native code. I didn't compare to NaCl (which would be apples-to-oranges since it is non-portable) nor PNaCl (which I am not sure is ready yet for benchmarking? Please correct me if not).

We expect to improve on the 2x later this year, this is just the first iteration. I do think 2x is quite promising already though - it's in the range of Java and C# (on a fast VM for them).

I'll be putting up some slides with more specific numbers tomorrow after I finish giving a talk on it.

Re:Asm.js: a strict subset of js for compilers – working draft by azakai on Saturday February 16, 2013 @06:06AM (#5231149)
Re:Asm.js: a strict subset of js for compilers – working draft by dherman on Friday February 15, 2013 @03:41PM (#5228499)
> It's rather indicative of Mozilla's approach to life, namely, write everything in JS out of some pseudomasochistic desire for backward compatibility hacks.

I'm just trying to make progress in a messy world. JS is not my ideal programming language (even though I've worked hard to make it better 7 years now (!) and counting). I simply believe asm.js has a good adoption/evolution story, and I want to web to continue growing and competing.

> The semantics of JS are pretty horrible too.

A cheap shot, and missing the point. The subset of JS, while being completely equivalent to JS semantics, is also equivalent to a low-level machine model. IOW, it gives you the semantics of a low-level but safe VM.

Re:Asm.js: a strict subset of js for compilers – working draft by fzzzy on Friday February 15, 2013 @10:28PM (#5230240)
Thanks for working so long on making things better. I think asm.js is going to be really great.
Re:Asm.js: a strict subset of js for compilers – working draft by chr1 on Friday February 22, 2013 @03:59PM (#5266758)
this http://blog.j15r.com/blog/2011/12/15/Box2D_as_a_Measure_of_R... is a bit old, but it suggests that NaCL is pretty close to native (only 20-30% slower) and jre is 2-3 times slower.