Flash, C/C++ and LLVM

November 18th, 2008

The most interesting thing Adobe has recently announced at Adobe MAX is (easily) Alchemy. It adds some modest support for C/C++ in Flash, but this is still nothing compared to how they did it. Tucked away in the Alchemy FAQ it mentions they used LLVM to do the job. It works by compiling C/C++ to the LLVM instruction set and then converting that to Flash bytecode.

LLVM is intended to act as a medium between a language and an instruction set. If you write a language that compiles to LLVM instructions, you automatically support any instruction set that LLVM supports. If you write a back-end that can understand/convert LLVM instructions, you support any language that compiles to LLVM instructions.

So basically, Adobe may have just opened the door for Python, Java, CIL/.NET languages, and others. I doubt they work right now (I haven’t had the opportunity to try Alchemy yet), and support for Flash’s API would be missing of course, but it appears to be coming.

7 Responses to “Flash, C/C++ and LLVM”

  1. retrogamer4ever Says:

    *mouth drops to the ground and eyes get wide* can you just imagine! o.o… That glories day when you can code in Python, Ruby, Java, .NET (C#, VB, etc) and have it all compile to a SWF… My god! It’s like some sort of wet dream 😀 God I hope this day comes 😛

  2. Owen Says:

    Scott Peterson talked about this, including showing Python on Flash, in his talk at the LLVM dev conference: http://llvm.org/devmtg/2008-08/Petersen_FlashCCompiler_Hi.m4v

  3. zproxy Says:

    You can compile your c# application to actionscript 3 today!

    Look at http://jsc.sf.net or
    http://zproxy.wordpress.com/jsc-javascript-script-compiler/

  4. C To ActionScript via Alchemy « c# to javascript, actionscript Says:

    […] C To ActionScript via Alchemy Filed under: jsc — Tags: actionscript, adobe, alchemy, c# — zproxy @ 6:54 am News by BrokenBlog: […]

  5. Billigflüge Says:

    Hmm -iam waiting for the ultimative program which composed every pros… But this are only dreams XD

  6. zproxy Says:

    The ultimate program? Like an AI which can develop other programs? 🙂 Maybe in 9 years?

  7. Rob Says:

    Seems to me like an awkward thing to do… what I *would* like instead, is a flash bytecode JIT compiler/engine with LLVM (with all its cool optimization features). Now THAT would be something 🙂

Leave a Reply