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