Cross-compiling ActionScript to JavaScript

Judging from the responses to my previous post about FalconJS it seems that many ActionScript developers are interested in learning more about the cross-compiling ActionScript to JavaScript.

These are perhaps some of the questions that you might have:

  • How the heck does this work?
  • Is it really possible to cross-compile ActionScript to JavaScript?
  • What are the problems?
  • Where are the limitations?
  • What ActionScript features cannot be cross-compiled?
  • Will I get 17,000 lines of JavaScript code for “Hello World”?
  • What kind of ActionScript code will increase the size of the generated JavaScript, or drag down performance?
  • How can you write ActionScript code that avoids code bloat and performance degradation?

Unfortunately I won’t be able to comment on any specifics in regards to FalconJS. But I can answer some of the questions above. So here is my plan: In this and the following posts I will try to give you a brief introduction to cross-compiling ActionScript to JavaScript.

I will start with the basics and slowly work towards more complicated problem areas.



Cross-compiling ActionScript to JavaScript

A. The Compiler

  1. 0.2 + 0.1 = 0.30000000000000004
  2. ActionScript != JavaScript
  3. Classes, Inheritance, Interfaces, Packages, and Namespaces.
  4. Const, Types, For/Each, and E4X
  5. Getting “this” right
  6. Static Initializers
  7. Do Arrays and Objects have side effects?
  8. Weak References
  9. Proxy
  10. Dictionary

B. The Runtime

  1. Dreaming up a Flex JavaScript SDK
  2. In the beginning there was Object
  3. Wrapping native JavaScript libraries in ActionScript
  4. What is in flash.swc?

C. The Rest

  1. Optimizing cross-compiled JavaScript
  2. About Humans, Horses, and Taxes
  3. Debugging cross-compiled ActionScript
  4. Testing cross-compiled ActionScript


4 Responses to Cross-compiling ActionScript to JavaScript

  1. David Buhler says:

    @What are the problems?
    @Where are the limitations?
    @What features cannot be cross-compiled?

    If you’re not able to comment on FalconJS, I’d be curious to hear how the Transpiler applies, relative to your understanding of Dart. That might shed some light on the limitations of compiling static languages into JS.

  2. Thank for keep going on FalconJS. will looking forward for more detail from you. 🙂

  3. Strange that you can’t talk about Falcon JS if it’s going to be donated to ASF rather soon. It’s not something that Adobe would be interested in keeping secret, is it?

  4. Kevin Newman says:

    Jangaroo has already done a lot of AS3 to JS conversion work – I’m curious as to how FalconJS will compare to Jangaroo (the cross-compiler part, not the Flash API, which Jangaroo implemented using it’s own AS3 compiler on top of HTML wrapper classes).