Monday, July 7th, 2008
This is where technology such as IronMonkey come in, as well as the work that Scott Peterson is doing, written up here:
Scott Petersen from Adobe gave a talk at Mozilla on a toolchain heâ€™s been creatingâ€”soon to be open-sourcedâ€”that allows C code to be targeted to the Tamarin virtual machine. Aside from being a really interesting piece of technology, I thought its implications for the web were pretty impressive.
If I followed his presentation right, Petersenâ€™s toolchain works something like this:
- A special version of the GNU C Compilerâ€”possibly llvm-gccâ€”compiles C code into instructions for the Low Level Virtual Machine.
- The ActionScript is automatically compiled into Tamarin bytecode by Adobe Flash, which may be further compiled into native machine language by Tamarinâ€™s Just-in-Time (JIT) compiler.
The toolchain includes lots of other details, such as a custom POSIX system call API and a C multimedia library that provides access to Flash. And thereâ€™s some things that Petersen had to add to Tamarin, such as a native byte array that maps directly to RAM, thereby allowing the VMâ€™s â€œemulationâ€ of memory to have only a minor overhead over the real thing.
The end result is the ability to run a wide variety of existing C code in Flash at acceptable speeds. Petersen demonstrated a version of Quake running in a Flash app, as well as a C-based Nintendo emulator running Zelda; both were eminently playable, and included sound effects and music.
Posted by Dion Almaer at 8:50 am