Roy and asm.js

178 views
Skip to first unread message

Michael Lorton

unread,
Mar 28, 2013, 4:30:12 PM3/28/13
to roy...@googlegroups.com
I presume that everyone has heard of the announcement by the Firefox team that their Spidermonkey JavaScript engine can run "asm.js", a subset of JavaScript, about half as fast as compiled code; e.g., mind-blowingly fast.   Perhaps many of you have even heard that Unreal Engine 3, the game engine that runs games like Mass Effect, Gears of War, and Infinity Blade, has been compiled into asm.js and run (again, mind-blowingly fast) in the Firefox browser.

My quick and inexpert perusal of the asm.js spec suggests that it would be easy to tweak the Roy compiler to generate asm.js instead of straight JavaScript. 

So, a strongly typed functional language that can run on any browser, 10 times faster than hand-written JavaScript.

Brian McKenna

unread,
Apr 1, 2013, 12:13:25 AM4/1/13
to roy...@googlegroups.com
Thanks for looking at Roy. I was at the announcement of asm.js at
mloc.js in Hungary. Really exciting talk from Alon Zakai.

Roy won't gain too much from asm.js at the moment.

asm.js is a manual memory managed environment, so we'd have to
implement a custom garbage collector. That's possible and we can even
tune the garbage collector to work well with Roy's semantics:

* Lots of allocation of short-lived objects
* Generational data (old objects can't point to young objects)

Great. Now here's the two primary questions for me:

* Could it complete with the engine's built-in GC?
* Do I want to maintain a garbage collector written in JavaScript?

Both answers are almost definitely not.

Mozilla has added "Support GC allocated Java-like objects" to the
OdinMonkey (asm.js engine) roadmap:

https://wiki.mozilla.org/Javascript:SpiderMonkey:OdinMonkey

That's when things will start to get interesting. That's still quite a
while off, so I'll revisit Roy on asm.js then.

Thanks for the awesome question,
Brian
> --
> You received this message because you are subscribed to the Google Groups
> "roylang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to roylang+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Michael Lorton

unread,
Apr 1, 2013, 3:11:46 PM4/1/13
to roy...@googlegroups.com
Wow, miss one small thing.  I'm surprised GC is so far down their priority list.  The lack really cuts into the utility of asm.js I guess the authors think of asm.js as a target language for compilers of languages that don't have GC now.  They really, really wanted that Unreal World demo.

But what are you doing partying in Budapest when we're all waiting for that type-system stuff?  :-)
Reply all
Reply to author
Forward
0 new messages