views:

39

answers:

1

I stumbled accroos the AS3 to JS compiler Jangaroo, which looks like it could be a useful tool since it supports a lot of things I like about AS3.

  • Are there any other such compilers?
  • Is there another language I could learn, that compiles to JS, that is AS3 like?
+3  A: 

HaXe

From the intro page:

haXe (pronounced as hex) is an open source programming language.

While most other languages are bound to their own platform (Java to the JVM, C# to .Net, ActionScript to the Flash Player), haXe is a multiplatform language.

It means that you can use haXe to target the following platforms :

Javascript : You can compile a haXe program to a single .js file. You can access the typed browser DOM APIs with autocompletion support, and all the dependencies are resolved at compilation time.

Flash : You can compile a haXe program to a .swf file. haXe can compile for Flash Players 6 to 10, with either "old" Flash<8 API or newest AS3/Flash9+ API. haXe offers very good performance and language features to develop Flash content.

NekoVM : You can compile a haXe program to NekoVM bytecode. This can be used for server-side programming such as dynamic webpages (using mod_neko for Apache) and also for commandline or desktop applications, since the NekoVM can be embedded and extended with some other DLL.

PHP : You can compile a haXe program to .php files. This enable you to use a high level strictly-typed language such as haXe while keeping full compatibility with your existing server platform and libraries.

C++ : You can now generate C++ code from your haXe source code, with the required Makefiles. This is very useful for creating native applications, for instance in iPhone development.

Also of possible interest to you: Haxer, a java project i wrote that helps convert AS3 code to haXe code. It is not complete, but it gives you a good start in converting your code.

Jason Miesionczek
great thanks, forgot all about haXe after reading about a while back - it sounds fantastic, but do a lot of people use it? and does it have a future? Haxer sounds interesting too - will def check out. (btw your blog seems to be offline at the mo)
davivid
i really can't say how much it is used, but i use it, and love it. I think it's future really depends on the libraries that are available for it to get people excited about using it. Like with Ruby, it didn't become widely used/known about until Rails came along. I've actually been thinking about researching an MVC based web framework based on haXe that could share components with Flash/Flex and create some kind of neat synergy between the client and server.
Jason Miesionczek