What is FalconJS?

This week Adobe announced plans for donating Flex SDK and BlazeDS to the Apache Software Foundation. The fine print of that statement mentions two projects, Falcon and FalconJS:

  • Falcon, the next-generation MXML and ActionScript compiler that is currently under development (this will be contributed when complete in 2012)
  • Falcon JS, an experimental cross-compiler from MXML and ActionScript to HTML and JavaScript.

You’ll find a few details about FalconJS towards the end of Adobe’s statement:

Q: Will Adobe provide migration tools to enable existing Flex applications to be converted to HTML/JavaScript?

We have undertaken some experimental work in this area, but remain unsure as to the viability of fully translating Flex-based content to HTML.

The Falcon JS cross-compiler, referenced above, represents this early work and intent to contribute this to the open source project.

So what is FalconJS? Is it any good? When will FalconJS become available?

Those are probably the questions that many Flex developers would love to have answered. Unfortunately, I can only begin to answer the first question (as the developer who came up with and implemented FalconJS).

FalconJS is an ActionScript to JavaScript cross-compiler based on Falcon, Adobe’s next generation, multi-threaded ActionScript compiler. From a distance, Falcon’s architecture looks pretty much like any other compiler architecture: a language front-end parses source code and creates an abstract syntax tree (AST), which gets reduced to machine code by a code generating backend. In Falcon’s case the language front-end parses ActionScript and the backend generates byte code that can be interpreted by an ActionScript Virtual Machine (AVM2) like the Flash Player. We call that byte code “abc”, which is the abbreviation of “Action Block Code” (and not “ActionScript Byte Code” like many people think). Most people are probably more familiar with SWF and SWC, which are just different package formats for abc byte code.

FalconJS simply replaces Falcon’s abc generating backend with its own JavaScript generating backend.
That’s my short description of FalconJS.

 

UPDATE (12/21/2011)

Adobe hosted a Flex Community Summit in San Francisco early December this year. The recordings are now available at Adobe TV and there is a segment about Falcon and FalconJS that I recommend watching:

Open Discussion about Falcon and FalconJS
http://tv.adobe.com/watch/flex-community-summit-december-2011/open-discussion-about-falcon-and-falconjs

Peter Flynn, who is with Adobe’s Flex team, did a great job explaining FalconJS’s architecture and its current limitations in regards to cross-compiling Flex applications. It might be worth pointing out that the recorded discussion refers to one of many specific use cases of FalconJS. Peter worked on a research project that investigated whether FalconJS could be used for cross-compiling Flex projects to JavaScript.

 

UPDATE (3/1/2012)

Adobe is in the process of donating Falcon and FalconJS to the Apache Foundation as part of the Apache Flex project.  If you are interested in the progress of those and other Flex related projects please subscribe to their developer mailing list.

 

UPDATE (12/10/2012)

Just a quick update on FalconJS and the Apache Flex incubator project:

On 11/23/2012 Alex Harui reported that FalconJS has landed in Apache’s source depot.

The source code is under trunk/compiler.js. There is also the asjs branch, which seems to explore runtime implementations.

 

 

55 Responses to What is FalconJS?

  1. John Smith says:

    There is already a Falcon programming language.

  2. Rezmason says:

    Falcon is also a type of bird. Real original, ADOBE.

    I’m look forward to experimenting with this. One big question remaining is what Adobe will do with the Flash API in the JS target.

    • Marlon says:

      Erm, and? Is this the first time you have encountered a product named after a living entity? It’s also a car… and a team, and a superhero.
      Be as it may, I am kind of getting weary about Adobe’s directions now… 😐

      • Har says:

        I think that was teasing the guy above who complained that “There is already a Falcon programming language.” (Who gives a shit?)

  3. guest says:

    Can you highlight some of the reasons that make you unsure of FalconJS’s viability at this time ?

  4. Josh Tynjala says:

    @John Smith Falcon is the codename for the compiler. It does not refer to a language.

  5. Jason says:

    Sounds very exciting, looking forward to hearing more

  6. Peter Witham says:

    Very interesting, we eagerly await further reports on progress and getting our hands on it.

    Thanks for the post
    Peter Witham

  7. Rob says:

    Are there any details on how things will be rendered? Will it all be created in a canvas tag or will the DOM be used?

  8. pointer says:

    one thing is true: the description is short.

  9. > We call that byte code “abc”, which is the abbreviation of “Action Block Code” (and not “ActionScript Byte Code” like many people think).

    In avm2overview.pdf (also linked from this article), the definitive reference from Adobe (dated May 2007), ABC is also referred* as “ActionScript Byte Code” and I guess probably that’s why many people think it that way.

    As someone who is very interested in SWF and ABC formats from the beginning, this is the first time I’ve heard the “Action Block Code”. I’m afraid it will be very hard to change what ABC means, which is “ActionScript Byte Code”.

    > Most people are probably more familiar with SWF and SWC, which are just different package formats for abc byte code.

    I beg to disagree, SWF is much more than just a package format abc bytecode.

    * Title of 4th chapter is : “The ActionScript Byte Code (abc) format”

    • Bernd Paradies says:

      @Burak: I realize that I might have over-simplified by saying that SWF and SWC are just ABC package formats. I do think that SWF and SWC are package formats. But there is much more going on in SWFs and SWCs than just ABC. To that extend I agree with you (if that was your objection). I referred to SWF and SWC, because most people don’t know what ABC is.
      You are also right that avm2overview.pdf refers to ABC as “ActionScript Byte Code” and not “Action Block Code”. Frankly, I don’t care either way. But I have listened to several Adobe internal talks about ActionScript where the speaker insisted that it’s “Action Block Code” and not “ActionScript Byte Code”. Could be that the original name was “Action Block Code”. Let me do some investigations…
      Thanks for pointing it out, though!

      • Thanks for taking time to reply.

        > if that was your objection

        Yes.

        > Could be that the original name was “Action Block Code”.

        I guess this was the case. And I’d assume to people who coined it initially, it will always be that. But I would insist that in the Adobe-external world, it is now too late to change.

        Best.

  10. Frédéric THOMAS says:

    “Can you highlight some of the reasons that make you unsure of FalconJS’s viability at this time ?”

    I’d like to know as well !

  11. JP says:

    What are your opinions on the Jangaroo project, is it not Falcon already implemented?

    For a compiler name how about ‘Phoenix’ for symbolic reasons 🙂

    “The phoenix has long been presented as a symbol of rebirth, immortality, and renewal.” – wikipedia

  12. Don Kerr says:

    I too am interested in how far you actually got with the experiment. How close was it to release? Will you/Adobe will continue to support this project after donation? Will Flash JS be incorporated into Flash Builder 5+?

    Appreciate your work on this! It would truly keep Flex/AS3 as a “driving” force in enterprise applications if I can offer to my clients yet another packaging option in JS/HTML5.

    Please post more details! This is exciting!

  13. Pingback: The first answer for FalconJS | FlexBlog say Flash & HTML5!

  14. FalconJS likes a jewel, shining in the dark. It’s never exist to public before. I start to think about Adobe’s plan should has something more than we know.

    Anyway, I will keep in touch on FalconJS. Thank you for the most wanted answer! 🙂

  15. Sanford says:

    Yes, we’d love to hear more about why there are doubts in Deepa’s note about the viability of Falcon JS, thanks

  16. Can’t you do this with Haxe right now? (Minus the MXML)

  17. Bernd Paradies says:

    Thanks everybody for your interest in FalconJS! I hope you understand that I can’t really comment on any specifics in regards to FalconJS. What I can do is following up with a series of general posts about cross-compiling ActionScript to JavaScript, which I will happily do so in my spare time.

    Thanks again and stay tuned!

  18. Thank you for sharing the information!

  19. Joseph says:

    Would love to get more information – and the potential of this succeeding?

  20. Pingback: Adobe abandonne Flex à la fondation Apache

  21. Frederic says:

    Can’t wait for more information on this, really exciting!

  22. George says:

    I sense another boat Adobe will be missing.

    If they think HTML 5 and JS is the future and want to support it with great tools, then what better way than to also bring their base (us! and the tools) to the HTML 5 promise land? Why dump us in the water if they can build a bridge?

    Because I’ve got to tell ya if I find myself in the water I’m looking for another boat. I’ve already got one foot on the GWT and JQuery barges as it is, and it’s my other foot in Flex that is getting wet.

  23. Raju Bitter says:

    When the OpenLaszlo team created the DHTML/JavaScript runtime for OpenLaszlo – as a 2nd runtime of the platform next to Flash – the team chose the approach to compile from JavaScript 2 to JavaScript 1.5. In Laszlo’s case the JavaScript 2.0 code is transformed into ActionScript 3, which is then compiled using the Flex compiler.
    http://www.flickr.com/photos/semanticmemories/3443758267/

    Laszlo managed to compile the massive Laszlo Webtop application (100k+ lines of client LZX code) into a JavaScript application, following this approach. The problem with compiling from ActionScript 3 to JS might be the fact that Flex uses features of Flash Player, which cannot easily be reproduced using HTML5/JavaScript.

  24. Raju Bitter says:

    Would Falcon JS enable the compilation of any Sprite/ActionScript 3 application into JavaScript? Or is there a dependency on a Flex JavaScript “kernel”, which would mean you can only compile a Flex application to JavaScript?

    • Bernd Paradies says:

      There are two levels of cross-compiling AS3 to JS:
      At the language level the cross-compiler needs to transform all the language features like classes, inheritance, etc. If the goal is cross-compiling ActionScript code from old Flash or Flex projects then you have to also implement the runtime code like Sprite to ActionScript so it can be cross-compiled with the client code into one “soup”.
      The Flash Runtime library has about 500 classes and some of those classes cannot be implemented for browser environments. In addition to the Flash Runtime code there is also special glue code that takes care of very basic stuff like instanceof interfaces.
      FalconJS’s glue code layer allows plugging in IFramework implementations. Frameworks are jQuery, goog etc.

      I will probably write up some more details in a separate post.

      Happy Thanksgiving!

  25. Raju Bitter says:

    Thanks for your detailed response. That sounds like a very promising approach! Still, developers hoping to be able to fully replace a Flash version of an ActionScript 3 or Flex app with a JavaScript/HTML5 version might be disappointed to find out how much of the Flash runtime functionality is missing in HTML5 at the moment.

    But to have ActionScript 3 -> JS cross-compilation integrated into the Flex compiler, with the option of plugging framework implementations into the glue code layer, would be fantastic! I’m definitely looking forward to the release of Falcon JS, and thanks for keeping all of us updated.

    Happy Thanksgiving!

  26. Yuval Ron says:

    I may be wrong but it sounds to me like a huge undertaking for a single developer, especially considering the importance of this cross-compiler for Flex’s future. Are you really alone on this?

    • Bernd Paradies says:

      It is true, I am pretty much the only one working on the JavaScript generating back-end for Falcon. There is one other developer from the Flex team, who did a lot of work in FlashRT and also fixed a bunch of FalconJS bugs. But the biggest chunk of the compiler work is done in Falcon and there are a bunch of highly skilled Adobe developers working on Falcon. So I wouldn’t worry too much!

  27. fox says:

    Hope they come up with falcon js soon developing html5/js stuff is so painfull

  28. Pingback: Sobre el futuro de Flex | Blog Comunidad AdobeXpert

  29. timma says:

    Adobe isn’t doing something to brighten Flash Authoring Tool future I am sad 🙁

  30. Yousif Atique says:

    My Fellow Flexers:

    My short suggestion is to start learning HTML5/CSS3/jQuery rather than waiting on a solid and stable build of FalcxonJS. You guys do not really want to end up in the same ditch again when FalconJS would come to EOL in the future, just like what happened with Flex.

    Adobe *must* not have made this decision. Sad to see that Adobe lost faith in its own plane.

    Regards,

  31. RogerV says:

    Sure, it’s fine enough for an individual developer to cultivate HTML5/JS/jquery skills. But companies that have invested in existed large code base of Flex business apps need a path to carry those forward. Starting from scratch and taking several years to rewrite these apps at least doubles the cost and delays meeting customers needs. We can run on existing Flash Player plugin for the meantime, but in the long term we need something like FalconJS to bridge us over to HTML5/JS.

    If Google’s Chrome browser can run Dart-based web apps significantly faster than JavaScript-based apps, then it might be interesting to target MXML/ActionScript3 to Dart. Dart has a tool suit to accommodate providing JavaScript to browsers that don’t natively run Dart.

  32. Camus says:

    I guess company will now think twice before investing in non standard technologies.
    There is no way flash will ever be able to translate itself into real efficient javascript , simply because it is 2 different paradigmes. And to render flash into what ? html/css ? svg ? webgl ? canvas ? with how much compatibility with hand written javascript ? with what performances ?
    IF you want to code for HTML5 , javascript , coffeescript or haxe are the way to go. Haxe is close enough to AS3 syntax and you can use pure javascript libraries with a bit of coding ( it uses wrappers i believe ). Dart cannot use pure javascript libraries.

    extJS is a good “flex” like framework with a lot of UI controls and it is quite easy to use if you are willing to use json instead of xml for configuration.

    There is no escape from pure javascript / coffeescript for serious HTML5 apps. But there is a interesting thing adobe could do with fireworks. FIreworks can , in theory , render projects to html . i’d like to be able to design my app in Fireworks , then get all my assets either in divs if they are rectangle ( or round rectangles ) , svg , images , etc … all my texts with the related @font-face , all my gradients in css , ect … it could lead to a very powerfull workflow. I

  33. Pingback: Sencha Ext JS is Viable Technology Choice for Flex Developers | Flex & Flash Consultant – Jesse Warden dot Kizz-ohm

  34. Pingback: Retour sur la soirée des Tontons Flexeurs avec Deepa & Adam Lehman | Blog Xebia France

  35. Abderraouf Allani says:

    Would you tell us please, when FalconJS will be available for download? and can any developper help in elaborating this cross compiler

  36. Doug Arthur says:

    Hi Bernd, can you please clarify your blog post, because Falcon, and FalconJS are NOT part of Apache, yet. They will be donated in the future, but have not yet been donated to the foundation. I’m on the commiters list, and it’s definitely not there.

    Please see Adobe’s roadmap: http://www.adobe.com/devnet/flex/whitepapers/roadmap.html

    “Falcon compiler contribution to Apache

    Falcon 1.0 is the next generation compiler for ActionScript and is currently in development. Upon completion of the ActionScript portion of the compiler, Adobe will contribute Falcon 1.0 to the Apache Flex Project, which we expect will be in Q4 2012.

    Falcon JS compiler contribution to Apache

    Falcon JS is an experimental ActionScript 3 compiler that targets JavaScript rather than the Flash Runtime. Adobe will contribute the prototype of Falcon JS source code to the Apache Flex Project after the completion and contribution of Falcon 1.0.”

    And see this thread on the Apache Flex Dev mailing list: http://markmail.org/search/+list:org.apache.incubator.flex-dev#query:%20list%3Aorg.apache.incubator.flex-dev+page:1+mid:pqxpsicjinzoc4po+state:results

    • Bernd Paradies says:

      Hello Doug,

      I wrote that “Falcon and FalconJS are now part of Apache Flex”, which does sound like those projects have been donated to Apache. At this point it would be more accurate to say that “Adobe is in the process of donating Falcon and FalconJS to the Apache Foundation.”

      I will change the note accordingly.
      Thanks for pointing this out.

      Best wishes,

      – Bernd

      • Michael Labriola says:

        Wouldn’t it be more accurate to say at this point that Adobe is continuing to develop Falcon and, at some point in the future will begin the process of donating it. So far as we are all aware that process hasn’t begun.

        • Bernd Paradies says:

          Hi Michael,

          this might be splitting hairs on my part, but in my opinion Adobe started the process of donating Falcon and FalconJS with their first announcement back in November 2011.

          Let me think of better words for summarizing the current status of Falcon/FalconJS…

          Thanks,

          – Bernd

  37. What is the Status of Falcon and FalconJS ? Would love to try it out, but it seemed to have died?

    Please at least show a sign of life of FalconJS Bernd Paradies, dont let this awesome work of you die !

  38. Rishi says:

    even we would like to know the status of falcon and falcon js. ….

  39. xeb says:

    Adobe and their projects… I always have my doubts. Now, how’s it going with Falcon? The efforts you wasted could’ve been well spent helping the Jangaroo team…

  40. Rishi says:

    please provide some info on Falcon JS. Let us know where it stands.

    • Jon says:

      Please don’t let the concept of FalconJS die.

      The combination of Flex and Actionscript with Flash Builder is an amazing development environment…but Flash Player doesn’t have a bright future anymore.

  41. Pingback: Adobe Flex: Is Flex ever going to export to HMTL5? - Quora

  42. Pingback: Cross-compiling Flex/Flash to Javascript | t1u

  43. Pingback: Will a future release of Apache Flex support cross-compiling MXML & ActionScript to JavaScript? | Jisku.com - Developers Network

  44. Akash Kava says:

    I was interested in flex to HTML for long time but we could not wait further so we created a new JS framework that allows us to code like MX XML, and provide binding and templates. It took us around a year to populate our framework with necessary elements. Please checkout http://neurospeech.com/webatoms/docs

    We are still documenting many parts of it. But this framework is well tested and mature. Even if you can not convert your project easily but you do not have to learn new things. If you know Flex then it is easy to learn and try Web Atoms.