Compile ActionScript in ActionScript

| 1 Comment | No TrackBacks

If you haven't seen the Tamarin news by now, what rock do you live under? Did you catch the part about the new ActionScript compiler?

I don't want to rehash what's already been said. JD does a great job at the above link to send you to various places for background information, impact, etc. Instead, I want to point out something that could easily be missed in the announcement: Adobe has released a "self hosting" open source ECMAScript compiler.

As Tinic mentions, the AVM2 code does not include a compiler. Adobe has a Java compiler instead (which you can download free via the Flex 2 SDK) that was built to help support Flex Builder 2. The separate compiler keeps the AVM2 code size (and therefore, the Flash Player size) smaller, but it also means that "eval" doesn't work. The eval function takes an arbitrary string representing code, and executes it, such as eval( "x = 10; alert( x );" );

To combat this, enter the ECMAScript compiler, written in ECMAScript (ActionScript 3). Take a look at the code in this directory, and in particular the parser itself. It's an interesting piece of work, but is only partially complete.

It's exciting to see this in development. As this code matures, we should have available to us a runtime compiler that can interpret ActionScript 3 code on the fly. I'm not sure that I'd use it much in my daily Flex work (I haven't had the need thus far anyway), but I appreciate the effort behind this and am looking forward to seeing it in action.

Tags: , ,

No TrackBacks

TrackBack URL: http://www.darronschall.com/mt/mt-tb.cgi/130

1 Comment

looks kinda sick. but it would be great if this project would bear an interactive console on a side effect like for ruby or python. i'd really appreciate this.

Leave a comment



About this Entry

This page contains a single entry by darron published on November 7, 2006 10:50 AM.

Convert Generic Objects into Class Instances was the previous entry in this blog.

How to load FlashPaper Documents in Flex 2 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Archives

OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.02