Calendar

November 2014
Mo Tu We Th Fr Sa Su
<< >>
12
3456789
10111213141516
17181920212223
24252627282930

Langs

The failure of AS3 ?

Posted on Aug 08 2009

Back in October 2005, Macromedia (later bought by Adobe) announced the Flash Player 8.5 Beta which would include support for a new programming language : ActionScript3 (AS3).

The player 8.5 - which was named this way not to frighten customers that just bought Flash 8 IDE - will later be renamed as Flash Player 9 and AS3 became the default programming language for Flash and Flex - replacing the previous AS2 - with the release of Flash CS3 Pro in April 2007.

Now, more than two years later, it's maybe time to check if AS3 was a success, or a failure.

AS3, a proprietary language ?

One of the promises of AS3 was to get out of the whole "proprietary language" thing.

Traditionally, Flash has always been criticized of being a closed-source platform (which it is) thus threatening one of the most beautiful and important things in the Web technology today which is openness : openness of protocols (TPC/IP, HTTP), formats (HTML, CSS) and browsers (Firefox and many others). Versus a full proprietary Flash platform, including an unkown programming language named "ActionScript".

The idea of AS3 was then to be based on the ECMAScript4 specification that was in the works and was supposed to become the next Javascript : Javascript2.

Sadly, since making a full programming language specification takes time, and is then not compatible with business agenda, ActionScript3 was released way before the EcmaScript4 specification was made available, and at the time the final ES4 spec was released, AS3 was already no longer compatible with it.

Furthermore, the whole EcmaScript4 process was stopped later due to political struggles between the major browser vendors (read my other post about it).

Of course, it's important to note that the AS3 compiler and the Tamarin Virtual Machine which run it were open sourced, which is of course better than nothing. But that is not what differentiate a proprietary language from an open one.

An open language has to be community-driven : people have to be able to express directly how they feel about it, and get answers to questions they might have about the way the language is designed and the way this particular feature works.

Also, the most technical users should be able to report bugfixes directly, and eventually provide full new features that have to be reviewed in decent time before getting included or rejected with a valid reason.

An open language is not about just opening the sources, it's about opening the process of designing and evolving the language.

So, here we are two years later : ActionScript3 is still a proprietary language, which evolution and control is entirely in the hands of Adobe.

AS3, better than AS2 ?

One of the major things that AS3 bring's with it is a whole new API for managing flash content. Entirely redesigned to be more practical, it should have greatly improved ease of programming for developers, versus AS2 which was hacked on top of AS1, with strange API coming from Flash 4 and even before that.

I mean, when you decide to redesign something from scratch without taking care about backward compatibility, you have an infinite freedom to design things the best way they should be.

One of the area where AS3 is definitely better than AS2 is speed : performances were greatly improved, and that's a very good thing.

However, in terms of usability, there was a lot of complains of "old school" flashers that had to write much more code in AS3 than in AS2 just to do exactly the same thing. Some might think it's pure conservatism : old men don't like when things are not in the place they were used to be. That might be true sometimes, but there's always some truth when so much people complain about API usability.

For example - I'm playing the devil advocate of course - but could someone explain me the advantage of writing the following in AS3 :

mc.addEventListener(MouseEvent.CLICK,function(e:MouseEvent) {
});

Against the following equivalent in AS2 ?

mc.onClick = function() {
}

Oh, I can hear you : listeners are very powerful, you can add several of them on the same object !

Right...

But how much probability do you have to need several click handlers on the same MovieClip ? Maybe one every hundred ? Or did you EVER need that ?

I'm not paid for programming on a per-line-of-code salary, I want simple things to be simple to write as well.

In terms of API design, IMHO AS3 went the wrong way : instead of making things that you write often be simple, the API gives you the power to make complex things, but simple things become very difficult and painful to write.

AS3, a full OO language ?

A third point were AS3 was supposed to shine was about being a "modern" programming language, with a full Object Oriented system, classes, real types, etc.

The issue is that for AS3 designers, a modern OO type system equals Java.

And not the latest Java with generics and many more features. No. The original Java, back from 1995, when at this time Java was already way behind many features experimented in research programming languages.

As a game developer, I enjoy the speed that a static type system can bring. I'm also a big proponent of strict type systems since as much type checking work the compiler do instead of me, as much I can focus on actually programming.

But the Java type system lacks one huge thing : expressiveness.

This is an axiom : the more the type system of a programming language is restrictive, the more people will try to bypass it by NOT using the type system, but instead Object and unsafe casts.

And the axiom reciprocity : the more the type system of a programming language is expressive, the more people can rely on it and the less "architecture overhead" there is.

Right now a lot of people are hating Java for its lack of expressiveness. Sadly, people are thinking that dynamically typed languages such as Ruby are the solution, whereas there are strictly typed languages which are much more expressive than Java...

The lack of many language features in AS3 such as generics, inlining, function-types, enums... have brought many developers to complain about the language. A language which has not evolved in the slightest since 2006. Some people really hate it now, and can you work daily with a language that you dislike ? Not if you have the choice...

I personally think that especially in the programming language design area - where I'm the most active - AS3 is a failure : it brings too much strict OO principles to satisfy people that prefer "scripting" procedural languages such as AS1/2, but fail to deliver in expressiveness for people that want actual features in that area.

AS3 is sick of the want-to-be-Java disease, and that's not one that you can easily cure.

What's next ?

I must admit that I'm biased in that review, and I haven't been using so much AS3 myself. I've mostly spent the last three years designing and programming in Haxe.

But I'm also listening to what people are saying, in conferences, on blogs, around me. And I wanted to put into words the feelings of the actual AS3 users out there, with my own analysis of why we got there.

Sadly, I don't think that AS3 can be fixed, or it might take years. Adobe has other priorities than listening to perfectionists developers, and they are masses of Flash customers out there that just don't care at all, maybe because they do programming only as a job without any notion of pleasure inside it.

But since I don't like AS3 and was for long time interested in programming language design and compilers, I came up with my own solution to this problem : after MTASC, I designed a language called Haxe and wrote a compiler which can compile it to Flash Player 6-8 and 9+, and can then act as replacement for both AS2 and AS3.

Since the initial release of Haxe, a lot of people have been contributing to it, making it a real community-driven programming language, which include many features that are not in AS3.

So instead of suffering in silence, I invite you programmers to act : give a try to Haxe, adopt it if you like it, and join our very active users community.

The language is maybe not perfect, but it's evolving quickly.

We know that it still lacks documentation, but that something that's getting better and better over time.

I can't guarantee that you will enjoy programming in Haxe better than in AS3, but I know a lot of people that made the switch and don't want to go back.

Just do something to help yourself.

To be more happy everyday when programming.

Try Haxe

--

PS : In case you doubt it, this is not an advertising, since I'm not getting a single Euro out of it, this is just a advice from a fellow developer ;)

63 comments
  • Subb
    Aug 08, 2009 at 02:17

    Excelent post. Pretty much exactly what I had in mind.

    Haxe is a wonderful language. The problem is, everyone need to dump AS3 to use Haxe at the same time, which is unlikely to happen. At work, we almost always give source code to the client, for some reasons. Sending a zip package full of Haxe code would certainly give them a big WTF face when they expect something in AS3.

  • Aug 08, 2009 at 04:25

    Great post, Nicolas. Some good points. I wish AS3 as a language had more velocity.

  • Aug 08, 2009 at 04:26

    One thing that would make me try Haxe today - if it could compile my AS3 codebase unchanged, and I could ease into the new features, instead of having to port the whole thing.

  • Aug 08, 2009 at 04:29

    Yeah great post,

    @Subb,
    IMHO, If you do need to provide AS3 source code to your clients you could always use the AS3 Code Generator, http://haxe.org/doc/flash/as3gen, and like all things in Haxe, if you find something that doesn't work or you think could/should be better you could always write to the mailing list or have a go at fixing it your self. Just my two cents.

  • Subb
    Aug 08, 2009 at 05:18

    @Adrian

    Well, I didn't knew about that tool! I'll give it a try.

  • Subb
    Aug 08, 2009 at 07:25

    @Adrian

    I tried as3gen. It worked well, but it don't think it's usable as we intent to use it. A simple trace in Haxe resulted in 9 AS3 classes. Of course, the final result is the same, except the AS3 code is much harder to maintain. And maintenance is the main reason why we give the source code to our client. At this point, it's probably easier to show them how to use Haxe than giving them a bunch of generated AS3 files.

    So although this solution can somewhat work now, what I meant by my first comment is that gigantic efforts will be needed to make Haxe the standard language to target the Flash Player. This could take as long as a complete remake of the AS3 language and compiler...

  • JLM
    Aug 08, 2009 at 07:59

    Ben is your codebase opensource, because if its useful and open it might get ported!

    If not try using AS3 classes in Haxe

  • Philippe
    Aug 08, 2009 at 09:50

    Java may be ugly and inexpressive (I don't like Java), it has still one of the largest dev community with great libraries and tools.

    So it's not all about the language - it's also about the ecosystem and,
    as I blogged recently, Haxe still doesn't integrate well enough with all the libraries and tools which make the AS3 ecosystem rich.

  • Aug 08, 2009 at 09:59

    @JLM: It is open source. www.pushbuttonengine.com

    @Philippe: I don't agree with everything in your post, but the ecosystem is essential, and while some parts of Haxe work to build an ecosystem very well (haxelib is awesome!), overall it's not peering well with AS3. Make Haxe support AS3 syntax and those problems go away. :)

  • joe
    Aug 08, 2009 at 11:13

    Do you have any plans to create better docs for haxe - I've known about haxe for a long time never messed with it because I don't feel like doing a crapload of trial and error - good docs would be a great way for you to promote haxe.... rather than adding new features you should create good docs

  • Emil Tamas
    Aug 08, 2009 at 11:18

    "I must admit that I'm biased in that review, and I haven't been using so much AS3 myself."

    "...But how much probability do you have to need several click handlers on the same MovieClip ? Maybe one every hundred ? Or did you EVER need that ?"

    OK, that was enough to make me stop reading. Pure crap if you ask me :)

  • martin
    Aug 08, 2009 at 12:13

    If there is a way to develop haxe on linux with step debugging then im in. :)

  • Oli
    Aug 08, 2009 at 12:53

    I prefer haxe over AS3. Unfortunately it is not so easy to use it as a Javascript replacement. Missing JQuery-like libraries...

  • stephen
    Aug 08, 2009 at 13:02

    "Oh, I can hear you : listeners are very powerful, you can add several of them on the same object !

    Right..."

    right... how about developing something more complex then a point and click interactive.

  • Tek
    Aug 08, 2009 at 13:46

    Nicolas,there's now an issue on the Adobe bugbase for the "proprietary language" problem that ask adobe to open source Flash Player : http://bugs.adobe.com/jira/browse/FP-2504

    I think that's a good idea to have the more people we can to vote for this issue.

  • Aug 08, 2009 at 14:06

    I tried HaXe a few times, and the only thing that stops me is the lack of a decent editor like FDT for AS3. I don't really mind having to write more code with AS3 that with AS2 because FDT does most of the job for me. I think, that such a powerful code editor is equally important as the language features if you look at things from an everyday work perspective.

    A few months ago a started playing with Unity3D and I decided to learn C# which is one of the languages available. I was really surprised to discover a programming language so advanced as C#!

    To refer to your adding listeners example, in C#, thanks to operator overloading instead of 'addEventListener' you just say:

    obj.listeners += eventHandler;

    and this is truly elegant. I hope AS4(?) will offer as much as C# offers in terms of language features.

  • Laurent Kappler
    Aug 08, 2009 at 14:29

    @Oli

    There's a javascipt port of JQuery :http://lib.haxe.org/p/hxScriptlet

    I'm not using JQuery but the ease of OOP coding javascript is amazing in HaXe. You write Ajax code in 4 lines switch to your neko Classes transparently. Neko/Javascript coding is pure sugare. It's about quiting web developpement or switching to HaXe :)

  • Aug 08, 2009 at 14:33

    @Subb : could you explain how you would prefer the AS3 code generated by Haxe to be more "maintainable" for your clients ? Except from inclusion of basic Haxe classes, it should correspond almost exactly to AS3 code as you would have written it.

    @Bartek (and Philippe) : IDE support is indeed very important and we take that seriously, there's very good support for Haxe in FlashDevelop3, but it's windows-only so far. For OSX, we have a bundle for TextMate as well, check http://haxe.org/com/ide

    @joe : could you tell us which part of the documentation is missing ? there's already quite a lot of it on http://haxe.org/doc, at least to get started.

    @Emil : please refrain from commenting if don't read until the end first ;)

  • Aug 08, 2009 at 14:47

    Hmmm I really want to get into Haxe but I'm spoiled ... spoiled by a good editor that FDT is. If FDT starts to support Haxe I'm sure I will eventually move more and more over to Haxe. AFAIK FlashDevelop supports Haxe already but Eclipse and FDT guides a big part of my working setup, style and practices. So that would be the only thing that still hinders me to move to Haxe.

  • Aug 08, 2009 at 15:07

    How can you call AS3 a failure when it's played a big part in helping expand the Flash market so much?

    "But I'm also listening to what people are saying, in conferences, on blogs, around me." - I think you're listening to what you want to hear, you want to hear justifications for why Haxe is necessary.

    Don't get me wrong, I think competing languages on the Flash VM will only make the platform stronger, but don't justify them on the basis that AS3 is a failure, justify them on the basis that different paradigms solve different problems. Adobe has gone after a specific domain/problem set with AS3. If Haxe can open up other domains, all the better.

    BTW, your event listeners example is BS, anyone with knowledge of component frameworks (like Flex) will know that most objects have more then one listener hooked all the time(to manage internal logic), even if the end developer has only hooked it once themselves.

  • Aug 08, 2009 at 15:16

    I can certainly appreciate your frustrations with AS3 as a language designer, and we're all aware of the designer / developer hybrids who've become frustrated with the complexity / verbosity of AS3.

    However doesn't it seem like Adobe's more focused on improving Flex for the end-user developer, and for most developers in the Adobe world language restrictions aren't such a big deal?

    Just taking your devil's advocate example of event handlers: in Flex setting up event handlers is really quite succinct, and the idea of moving layout to something like mxml (which is less verbose for instantiating and positioning display objects) seems to really be taking hold, and makes life a lot easier than the AS3 equivalent.

    Now I know this is a discussion about language, and your points still make sense. Just wanted to point out that Adobe's more interested in building out toolsets (like FlashBuilder / Catalyst), and if working with the lower-level language hurts a bit - well it's probably in Adobe's interest as it drives developers to use their software.

    It is frustrating though, for instance their introspection api is broken - you cannot get types of constructor arguments without a workaround, and metadata is lost on constructors. If there were language purists at Adobe, surely these things wouldn't remain broken for so long! They certainly wouldn't if it were an open-source language ;)

  • Aug 08, 2009 at 15:29

    @stephen & justin : I was not talking about handling different events on the same object, which can already be done by using different methods in AS2 (onClick, onKeyDown,...)

    I was talking about having different listeners for the same event, which is what addEventListener brings compared to AS2 direct method-binding, at the cost of additional complexity.

  • Aug 08, 2009 at 16:12

    I've never coded seriously in AS3, so I can't comment in depth,however it looks very much like the designers were heavily influenced by Java, and maybe that is the weakness.

    "And the axiom reciprocity : the more the type system of a programming language is expressive, the more people can rely on it and the less "architecture overhead" there is."

    I agree with this, however, it depends on your style. You can, as I did, write Haxe like Java, which is a great help for crossing over, but it takes a while to get into the Haxe/javascript functional style. If you do the NC axiom holds that architecture overhead is minimised - maybe AS3 defers too much to the Java style and has lost the spirit of it's ancestors.

    The main thing to say is that Haxe (and open source generally) provide a much needed counterpoint of spirit and simplicity to kludgy corporate offerings and shows that it can be better.

    bd

  • JLM
    Aug 08, 2009 at 16:31

    @joe: Flash is not brilliant for documentation, many have always relied on forums, blogs and books. Haxe site actually has all you need to switch from flash to Haxe, but there is also has a very good recommended book something that will save you hours, a forum and a mailing list where compiler writers often help and an IRC channel, so I can't see that the documentation argument holds much water and the amount of useful information seems to be expanding rapidly.

  • JLM
    Aug 08, 2009 at 16:42

    @Ben for Haxe I would suggest using physaxe rather than Box2D. The main advantage of a port might be that you would be able to run your code on the iphone or to some extent on javascript and certainly on the desktop.

  • Aug 08, 2009 at 16:43

    As someone whose looked at Haxe for flash game development and ended up with AS3, I think this would be a good time for me to highlight my reasoning.

    To start off, I really want to use Haxe. In my latest game I wouldn't be surprised if I've already wasted an hour waiting on the compiler. Possibly longer if I count times that I ended up on reddit while I was "waiting". Super-fast compilation speed along is probably worth it. I remember the error messages being a bit more useful too.

    So, here's my reasons for not using it:

    * API Integration: Last I checked, getting support for things like Mochi Games or Kongregate was tricky or simply not looked into. Has this changed?

    * Documentation: I can look up a lot of things about AS3 just by typing them into Google with as3 prepended. I don't remember Haxe being terrible in this respect, but it is much harder.

    * Asset Embedding: In AS3 I can do this inline. I spend a lot of time messing around with XML in my day job. The last thing I want is to do the same in my hobbies. Telling people they'll have to use swfmill, when it has a big "we're not really stable" disclaimer on the front page really reduces my confidence here.

    * Libraries: The above-mentioned using AS3 classes is a great start, but in the end calling AS3 in AS3 is easier than calling it from Haxe, especially since it looks like running an AS3 translator over the library is the best way to make things happen with little effort.

    The bottom line, for me, is this. Haxe, as a programming language, absolutely demolishes AS3. I am in complete agreement with you there. However, Haxe, as a tool for Flash development has a few things that raise some questions. I want to make games as a hobby and, hopefully, distribute them and make a bit of cash on the side. The hobby part of this means I don't really want to mess around with integration pains, and would love to be able to grab someone else's library and just use it when I need to.

    I'm not really trying to be one of those "here's how you must change your open source project to fit my needs" people. It seems like you want people to see Haxe as a valid option compared to AS3. I would love to see it become an even more valid option in the above ways. I'm relatively certain my opinions aren't unique here, and at the least would like to make sure my problems get added to the list of improvements you consider.

  • Oli
    Aug 08, 2009 at 16:59

    @Laurent

    the last hxScriptlet version is from 2007, I don't use libs that are not supported anymore.

    IIRC haxe is still missing a selector engine

  • Alex Bustin
    Aug 08, 2009 at 17:30

    public class SimpleSprite extends Sprite {

    ``pubilc function set onClick(callback:Function):void {

    ````this.addEventListener(Event.CLICK, callback, false, 0, true);

    ``}

    }

  • Ballsanus
    Aug 08, 2009 at 17:59

    Hmm, I concur.

  • JLM
    Aug 08, 2009 at 18:10

    @Adam: I believe Robin is working on a tool to make using assets simpler , I seem to remember seeing a screen shot somewhere but am unsure if there is any source currently to play with.
    asset tool and haxe preloader
    But there is no reason not to just load a Flash movie of assets into Haxe code at run time and composite the symbols into Haxe classes, seems logical to separate code and design and have a light preloader of just the code.

  • Aug 08, 2009 at 19:00

    "anyone with knowledge of component frameworks (like Flex) will know that most objects have more then one listener hooked all the time(to manage internal logic)"

    Maybe that is one of the reasons (yes one of many) the Flex component system is such an unusable pig. I'm not saying you don't need multicast, just there are much better ways to get it, especially internally. Flash is getting the Java attitude that somehow performance doesn't matter, which is like code cancer. If that becomes ingrained in the Flash culture, the writing is on the wall...

  • Aug 08, 2009 at 19:07

    Great post Nicolas. I guess it is hard to undestand your post to a full extend if someone has not talked to you before personal. Since we had a lot of discussions about Haxe, IDE integration and language design I think I know what you mean with the Java-disease and I completly agree.

    By the way: I really like Java now for server side development. The language is sort of okay and with 1.6 some good stuff has been released. This makes me interested in 1.7 as well. I am developing Java currently fulltime.

    The addEventListener example is a mistake though. Imagine you have a listener like stage.onEnterFrame and you have two third-party libraries that want to listen for enter-frame events. They would both override each other.
    I would go for the C# way here using operator overloading and typed delegates. I think it makes a lot of sense. obj.listeners += delegate and obj.listeners -= delegate is very nice.

    By the way I do not think Haxe is lacking a lot of documentation but one big problem is the layout of the reference.
    Besides that a really great IDE is important. I wanted to start writing a VS plugin but that is not possible with the express editions unfortunately. I do not know about the progress of the Eclipse plugins but we can definitly have a look at it again.

    Another question I asked myself: When are you finally going to implement the Haxe compiler in Haxe instead of OCaml? This would be a killer feature and it would be easier for people to extend it. Compiling to memory would be such a great feature.

    Best,

    Joa

  • Aug 08, 2009 at 19:08

    Hey you're right, the "baby" as3 will be 4 years old soon !

    And gotoAndStop() still not working correctly...
    ( https:bugs.adobe.com/jira/browse/FP-901 , https:bugs.adobe.com/jira/browse/FP-1719 , https://bugs.adobe.com/jira/browse/FP-43 )

    Another big failure of as3 is that integration with timeline suffers many bugs, making very hard to designer-programmers (like me) to control the timeline using as3, or inversely, to put Class instances in the timeline.

    Because the majority of JIRA users are "pure" developpers, those bugs don't get many vote, and will probably not be fixed before the 1000 others bugs (rough estimate: year 2020).
    It's a chance for adobe devs, because gotoAndStop() is probably the most complex feature of flash, and debugging it must be a nightmare ;) lol

  • joe
    Aug 08, 2009 at 19:16

    I guess I should have double checked the docs before posting that comment - they seem to have significantly improved since the last time that I checked - also, I wasn't aware there was a haxe book.

    I'll review the docs for a bit and see if I have any additional comments... after spending about 10 minutes skimming is there an AS3 haxe comparison page? Something like this but more comprehensive:

    http://processing.org/learning/compare/actionscript.html

  • Aug 08, 2009 at 19:40

    @Alex Bustin +1 someone should try and pack that class with all the things people usually b1tch about.

  • Aug 08, 2009 at 19:45

    @Nicolas to be fair I often find myself writing 10% of project code that is actually interesting to write, and that jolds some "point" in it, and other 90% is just boring "glue" code. But, to be fair, again, I don't think Haxe makes this ratio any better. For example, take the sandy3d port - in most cases, you could even write atomatic as3-to-Haxe convertor, since as3 and Haxe code we have is, in the end, nearly identical.

  • Subb
    Aug 09, 2009 at 02:41

    @nicolas

    Well, I think the result looks too generated. Maybe it's just a feeling. Things like if(!flash.Boot.skip_constructor) in every constructor or every variables typed with their full name doesn't make sens from a humain point of view. Maintainers need to understand the code to make change to it and those things are bumps on their road that I don't want to add.

    Also, it's hard (impossible?) to keep in sync with the client. For example we give them the source, they modify it, and then ask us to add a feature new feature. We can't used the Haxe code anymore because they made modification to the as3 code. In this case, it would mean that maintenance would be only in "generated as3" the moment the code leaves the house.

    Another problem with Haxe + generated code is probably my boss. We are still a small company and he makes everything he can to push it forward. So in is mind, I think, clients goes before devs happiness. Anything that could possibly scare just a nano bit of a client left little toe is out of the question.

    :-/

  • stephen
    Aug 09, 2009 at 03:34

    @nicolas

    I know this is all fine if the event your handling is only going to be handled by one comonent i.e. a mouse click, but when you start developing components in your system which throw out general information i.e change of data, a sub componet closing then your going to need a bit more flexibility.

  • Aug 09, 2009 at 05:50

    I am in total agreement with you about the direction that Adobe took with AS3. Since it's release I've been fighting with it and attempting to make it easier to work with, this includes writing a Scheme interpreter on top of it as well as a ton of utilities to make it easier to use. What most people don't seem to realize about AS3 (and I didn't until just recently) is that you can create functions in the root package that can then be used without importing or using a static method on a class. This has completely changed the way that I develop, allowing me to build up on top of AS3, creating functions like getURL and others that make AS3 a more friendly place for me. I've also just written a utility that utilizes the proxy object to create an object called $ that sits in the root package and allows for easier use of event-listeners. I wrote about it here. It allows you to write code like
    $(myClip)._mouseDown = function() { trace("clicked"); }
    or
    $.create.Sprite.addTo(stage)
    .beginFill(0).drawRect(0,0,10,10).endFill
    ._mouseOver(function() { trace("over"); })
    ._mouseOut(function() { trace("out"); })

  • Aug 09, 2009 at 12:21

    I admire your passion and ability to execute and I consider haxe an excellent tool for boosting the performance of expensive algorithms. After reading your analysis, I wonder why you then created a new language and didn't leverage the ecosystem of an existing language. In my opinion, there is a huge potential for Flash in tapping an existing language world. It's not really important whether it was Python, F# or whatever language you choose as long as it has a thriving community behind. It's also clear that the AVM imposes some limits to complete the implementation. However, it made so many problems easier to solve such as IDE support, testing frameworks, customer acceptance, higher developer proficiency due to the same language on client and server side, etc, etc.
    But hey, you're are in thinking that I should start my own APython compiler...

  • Aug 09, 2009 at 16:31

    midi support would be great, do you plan to add it in Haxe?

  • Aug 09, 2009 at 17:59

    I've coded in both AS2 and AS3 (a lot in AS3), and I have to say AS3 is generations ahead. It was a big change though, so I can see why AS2 folks would resist move to AS3 - there were tons of anti-AS3 posts on forums at the time.

    Now, to your points specifically. A big problem I found with AS2 was the inconsistency of the API, e.g., event handling WRT simple buttons and stuff vs. components. And how you can tuck away snippets on the timeline. With AS3, the addEventListener() thing made it consistent. Verbose may be, but certainly consistent and maintainable.

    And all the strict OO and compile time checks are frustrating to AS2 folks getting started on AS3, but it forces discipline and you will quickly realize how easily you can catch dumb errors early on, rather than breaking your head at run time.

  • anon
    Aug 10, 2009 at 02:46

    This is quite a hyped-up post. I for one LOVE coding in AS3 and cannot imagine going back to the AS2 madness. I guess it's a good publicity stunt to bash Adobe, but you clearly have no idea of the impact AS3 and Flex has had on larger complex RIA's.

    And people complaining about the Flex framework, the Flex 4 framework is a game changer and probably the most flexible and powerful Flash platform - based component set I have ever worked with. If it really does'nt fit your needs, then you probably need a custom component anyway. Agreed, file size may be an issue for some types of apps, but with the RSL enabled, size is good enough for most broadband-based use cases

  • Aug 10, 2009 at 07:15

    AS3 is by far the best thing that happened for Adobe and many of us developers. It made people recognize this standard on the web and its ability to deliver vast and diverse quality online apps. Till as3 flash was just the gimmick tool. Why not team-haxe and the team at Adobe work together and make something even better and solve these unwanted problems that we developers have to face. I personally would like to see actionscript alive and kicking in near future too as many of my other fellows. Adobe did open up the standards a lot which made us developers create libraries and APIs for AS3 and have propelled the platform forward. Why compete when we can all try to make the platform even better. Just my thoughts

  • Macaca
    Aug 10, 2009 at 10:12

    I wont consider switching until there are more and better docs for Haxe: atm is is still too risky to shift our business, too much chance of unexpected problems.

  • tomsamson
    Aug 10, 2009 at 11:06

    I say it out loud: AS3 is a big failure.
    It doesn´t satisfy the needs of Java or C# type developers and on the other side it alienates the majority of the flash designer user base as thanks to AS3 and the way the GC and the player works with it many, many things possible in AS1/2 are buggy or just not usable now.

    I am very glad that finally more and more of the flash platform known personalities speak up here, i hope Adobe finally listens and acts propperly, otherwise its their own fault when in a while flash is skipped for other things by most.
    I´ve already complained about many things regarding AS3, the flash player and the flash platform and its tools´evolution in the past, in a time when the hype around those was much bigger and anyone talking negatively about em in public was quickly disregarded as not being a profesional developer and just not getting the all great new thing.

    Yes, there are many core functionalities like keyboard and mouse handling which are just buggy on many ends and other core functionalities which are just plain overcomplicated and very error prone to that when using AS3.

    No, i´m not less a professional because i want to get my work done as fast and as reliable as possible and yes, AS3 on many ends is worse in that even than AS1 and 2.

    AS1/2 often lead to less clean coding and structuring but at least most things were more reliably implemented than with AS3 and flash 9/10 player.

    Sure, different types of people want different types of things and with flash tools and language variations VERY DIFFERENT types of people use it.

    Adobe has this identity crysis of not being sure whom to cater for.

    They listened to the designers, the developers moaned about lack of progress, they listened a lot to classical developers who want to code like in Java or C# with AS3
    and many designers and people who want to create things but have the code side be as simple to use as possible complained.

    Then regarding less AS3 having less usability, being more error prone and generally way longer winded to do, some say:

    but, but..., you can do wrapper classes, your own framework that simplifies things and hey, if you have a great code editor that takes half the work from your shoulders cause it auto writers lots for you.

    And then i say:
    really, that is your solution for a problem in the language?!?
    If all those things are needed to make it halfway as usable as the previous or other languages its just ill designed (or copied).
    And AS3 needs all that stuff to be halfway useful at all so it is a big failure. And i know i speak for the majority of the userbase with this.

    Yes, to attract a certain type of developer AS3 has to get closer to C#, but to attract another type of user, maybe a very creative designer or one man gang guy who brings up "wow"s to millions of people when they watch his content, the more designer friendly syntax/language AS1 AS2 versions have to be kept supported, too and the new language has to do away with overcomplexification of trivial things.
    SeeNicolas post. Even if his event listener sample is a bit off it hits the general vibe of needing way too much code for basic things (see joa ebert´s reply there for a fix suggestion).

    Essential: Movieclip functionality is broken, gotoandstop, nested movieclip control, garbage collector issues.
    How can Adobe release something that brakes such essential Flash functionality?!?
    Flash´s only advantage that can remain over the other technologies is allowing combining code and media like with no other tech out there and AS3 totally destroys that side.

    I think these things would make all happy for sure:

    -Performance raise of the flash player:
    Many beg for gpu acceleration for many years, some misunderstand that as asking for 3d acceleration and features alone, that is not the point though.
    The point is that the slowest part in flash content is handling the graphics and gpu acceleration for all graphical operations would help a lot there.
    Then people who aren´t into using AS3 wouldn´t have to use it just to get that tidbit more performance cause everyone gets a huge boost of performance.
    Seriously Adobe, if you can´t do it get some guys on staff who can.
    Look at Scaleform.com or look at swfbox or gameswf to get some inspirations and maybe talk some guys there.

    -Make all api features of flash available in AS1 and 2, too so its personal choice what one wants to use, not forced upon the userbase by you.
    Don´t tell someone he is outdated or less professional cause hes more a designer than a coder or a coder of different type than java copy thinker type.
    -Go a step further and do it like unity and mono where one can use all versions of the language (there its several languages like JS and c#) in one project in seperate code files and it all gets compiled to closer to machine code so all erform faster than now

    -fix or replace the Garbage Collector of flash player so it does memory handling more automaticly again like the old GC, even the circular references problem of that was way better than the crappy error and memory leakage prone crap java clone you got going now.

    -Improve AS3 to make it more reliable and reduce amount of code needed for simple tasks like event handling and other things so its actually less error prone and more handy to use and allows to get things done faster.

    once you´ve got all these sorted out both designer and developer groups would be more happy and you could move the player and language further.

    As it is right now i have the feeling you are only listening to what a few handful bloggers want or some virtual bigger picture (lets become more important in the mobile market) while things like those listed above would help you stay afloat and become more important to all again actually.

    I´ve written down complaints and suggestions here, on many other forums, blogs and your suggestion and whatever pages etc now, and as you can see many others are doing the same, don´t disappoint us this time.

  • Freaka
    Aug 10, 2009 at 11:43

    HaXe seems to be great but we need more information on how to use it in a designer/developper workflow. For example, if a designer design in Photoshop, integrate and animate in Flash, how to use his work without separate it in differents assets ? In a simple question : how to emulate Flash IDE with HaXe ?

  • Aug 10, 2009 at 12:58

    how do you use as3 libraries in haxe project ? i dont see any explaination on this in your doc. it seems not possible, so why do u think we as3 developers will switch to haxe when many important libraries are in as3. haxe is better in as3 , i admit but still not really useful for now. just my 2c

  • datafunk
    Aug 10, 2009 at 15:57

    Not heard of haxe before, seems very interesting...

    But AS3 is not a failure, since I migrated to flex and AS3, making flash applications/websites, things got more efficient and made more sense doing it. Once's you have AS3 your fingers, you will like it, just like me,...

    The problem is, AS3 seems to be more difficult, so programmers end up writing actionscript, and some programmers are programmers (they have not allways a creative mind) and tend to make it more difficult then neceassy...

  • tomsamson
    Aug 10, 2009 at 16:21

    datafunk:
    Your post shows one of the core problems with the "evolution" of the flash platform: I think several people at Adobe have a view like you, which is all people would like AS3 once they try it for a while. You know what? Several years have passed, many, many have tried it and well, not the majority likes it, actually the majority of the flash userbase heavily dislikes it.
    I´ve used AS3 for several projects and it lacks a lot of usability compared to the AS1 and 2 workflow. As said by me and others before it is way more error prone and longwinded.
    It breaks lots of core functionality of flash like controlling nested movieclips, dynamically loaded and unloading swfs and generally handling media and assets without risk of garbage collector related memory leaks and other problems.
    Who has no understanding for that maybe never got what was special and good about flash in first place.
    Its like initially flash was made by people who wanted to make creativity and expressivness accessible and now its lead by people who want to copy Java without thinking about how they are destroying the good sides of flash while doing so.

  • Bruno Garcia
    Aug 11, 2009 at 00:07

    Totally agree with the Adam Jone's points. Scala has won over Java developers because it's simple to leverage existing code written in Java. If you're trying to convert AS3 developers, being able to at least import AS3 compiled SWCs would be a huge win! :)

  • Dan Turing
    Aug 11, 2009 at 17:11

    @Adam Jones

    Sorry that the "0.2.x is considered 'pretty stable'" disclaimer on the swfmill site seemed to destroy all your confidence. I'm used to very conservative versioning systems like gstreamer's - which is, after years of development, default integration in GNOME (thus all major linux distros) and a strong stable series ABI/API compatibility program, still not 1.0. I can see of course how such a thing would scare you when used to corporate versioning schemes.

    Anyway, just want to say that "pretty stable" in open-source terms probably means "stable as rock" in proprietary software terms. It's being used in hundreds of projects. It doesnt crash randomly (only maybe with some real strange fonts).

    "Stable" would mean the XML structure will be supported for all forseeable future. That wasn't something i wanted to commit to...

    swfmill just got a new maintainer btw, so we're expecting a new release soon finally. Let's see what kind of version and stability declaration it'll get :)

  • Aug 13, 2009 at 16:18

    I use AS3 daily, and, while there are things about it that annoy me, I feel it's miles ahead of AS2. I used MTASC back in the day, and I've followed Haxe since its inception. I have spent considerable time playing with Haxe, but have never used it in a professional project. After reading all the comments in this thread, I'd like to add a few of my own.

    1. Documentation: I'm sorry, but you simply can't call the documentation adequate or complete. On a typical API page (http://haxe.org/api/flash9/display/bitmap) there is no description of the Class beyond its signature. There are no paragraphs of explanation, no examples, and no sample files to download. If I want to read more about the Class, I have to Google the AS3 version of the documentation (it would be nice to provide a link to that).
    What about Haxe and Flex? I see a single page of documentation (http://haxe.org/doc/flash/flex?lang=en) with a few snippets of code. Frankly, I would not even bother to attempt this sort of thing without a sample project to download. What if it doesn't work? Then I have to hunt on message boards to try to find a solution. (It would be a good idea to integrate comments directly into the documentation, like Adobe does.)
    I realize that documentation is a ton of work, but as a developer, this is simply not enough info for me to work with.

    2. What is the killer feature of Haxe over AS3? On the surface they are very similar. This page - http://haxe.org/doc/features - lists a few items, but does not do a good job explaining what they are, giving examples, or selling developers on why they are needed. Enums and Type Parameters sound cool, but off the top of my head I can't think of anything they enable me to do that I currently can't. If you said Haxe had multiple inheritance or operator overloading or even pseudo multi-threading, that might get the attention of a lot of Flash Developers; but it doesn't.

    3. Switching to Haxe is going to be a sacrifice for people. They will have to abandon or port old code. They will not be able to interact with libraries like Papervision as easily. They will have to sell their boss and co-workers on the language. etc. To get people to switch, you need to make the case that Haxe is not just slightly better but that it's indispensible. I think I'd like to see a lot more examples, and "apples to apples" comparisons on your site. You place a lot of emphasis on the fact that Haxe is "multiplatform", but I don't think this is a huge selling point for a lot of people. In most companies, the person writing the AS3 code is not the same as the person doing the backend, so it doesn't matter whether they use the same language.

    I'm sorry that this sounds so mean. Nicolas, I am huge fan of your work. Please don't take my comments as being antagonistic. I would love to see Haxe succeed. But I wanted to share my honest criticism after following Haxe for several years.

  • pix'nlove
    Aug 15, 2009 at 20:44

    Ahhhhh at last,
    Someone read my thoughts, and It not just someone it is
    the great Nicolas cannasse.
    I do program in haxe, and enjoy every single moment.
    I have design many successfull application, games and websites that I sold for school and organisation in England.
    All done with swhx and haxe.

    Everytime I have produce Flash animation a project, and have to decide wether I use AS2/AS3. Now I know longer hesitate and always opt for AS2.
    I have struggle some much with AS3 and I just can take it anymore...

    I use to think that people woh program with AS3 and enjoy programming with certainly did program for game and interactive application.
    Ok we need the speed of AS3 I am sure entirely sure how much speed it provide d'ailleurs.
    Anyway thank you Nicolas, I use to thing that you are just like those hypocrite who says: AS3 is a so much more mature language.
    Yes right If you want it to look like Java ok.
    Oh yeah I do hate Java as a language.
    My question is why can people make things as simple as they should be.
    I mean C/C++ are not that bad I were created in the 70/80...ok change is good... but you don't create a new language like AS3/Java trying to structure an organise and make task harder for programmers who want to enjoy the programming experience.(specially game programming)...
    why on heart anybody want to change that:
    mc.onPress = function(){
    ----
    }
    Anyway thanks Nicolas for sharing your frustration too...

    Long life to Haxe!!!

  • Martin Quinson
    Aug 18, 2009 at 02:57

    I agree with adampasz, one good way of making the documentation shortage easier to deal with for newcommers would be a few sample projects.

    I've found http://gm2d.com but there is only one example there, and the project internals are quite messing. Moreover, it's flash-only where I'd like to see examples of cross-platform development.

    I'm sure that I missed a lot of other examples, and that some of you guys could point me to them (please).

  • MKN
    Aug 27, 2009 at 10:51

    It seems to me that there are two frontiers. The first one is made of long-time flash developers who mostly deal with animations of all sorts and need a scripting facility for it. And as such AS2/Flash seems to be appropriate. The second group consists of application developers (like me) who have tried Flash a dozen times and have always got frustrated with the scriptish programming model. For the latter group AS3/MXML is a huge improvement whereas the former may not benefit from it that much.

    What AS3 and Flex in particular make possible is writing larger applications with ease. As somebody put it: "AS2 is a scripting language you can use to write applications with considerable effort. AS3 is a programming language that you can use for scripting purposes with ease." :)

  • Aug 27, 2009 at 19:24

    I've just finished the first pass at an AVM1 Event Proxy. It'll allow you to write AS2 style events... onRelease = function() {} ... etc .. in AS3 :)

    http://thebackbutton.com/blog/88/avm1eventproxy-as2-style-events-for-as3/

  • Ole Jak
    Sep 15, 2009 at 15:20

    Okli dokly... AS3 can and I hope will be extended far beyond Java and even in some ways (NOT IN SPEED) beyond C with Alchymy (I hope so...). (My opinion is based not on just brining new features to AS by libs but by taking C Java Lua Etc code and just running it in AS3 app as part of it* )
    PS Always wanted to ask you when well see Haxe based MXML like language?
    *My opinion here is based on this project achievements http://code.google.com/p/lua-alchemy/

  • Simon Asselbergs
    Sep 21, 2009 at 19:25

    Nicolas, first of all a big thank you for Haxe. The language seems to fill in all the blanks Adobe left. The language has a jewelry kind of quality to it, it's so intuitive it's hard for me to even begin describing why.

    In some companies there is still much dispute if Silverlight or Flash will be dominant in the future. Haxe has the potential to have an answer to that. If Haxe would support Silverlight (or the open source variant moonlight) it would be extremely neat.

    There is still something I would want to add to your article. When Flash was more of a designer tool with some simple scripting abilities, the scripting provided an easy learning curve. The community of actionscripters tried to use flash for thing it wasn't designed for and pushed flash scripting to it's limits for every new version. The big bottle neck was speed and maintainability and a IDE which wasn't developer friendly. Macromedia then listened to the community by trying to make the code run faster. The improvements needed to achief that goal, included some changes which made the script more verbose.

    Flash was less intuitive for designers since actionscript 2.0, and still not friendly enough for developers to use it for large enterprise applications. The latter has changed for the better since Actionscript 3.0. Flash now more a developer tool than a designer tool. Adobe may change that with Catalyst or FlashBuilder, but we still have to see what these product have to offer in real world usage. I think it's hard to avoid that some designer professions will require more coding skills in the future (deselopers). I think it this change of profession which made (and still do) designers complain about the learning curve of actionscript in flash. But the thing is that they have an even bigger learning curve to design, code and maintain ajax applications. However at some point on the timeline, when flash was in between a designing tool and development tool, they had a point.

  • Simon Asselbergs
    Sep 21, 2009 at 23:57

    @adampasz
    Porting or learning a new language is no big deal, seriously. I felt porting my projects from as3 to Haxe was a breeze. I really felt that the expressive power and less verbosity made it easy for me to get fast better peformant and easier maintable code. Porting is a small investment and all the improvements are definately worthwile the effort.

    You're right about the documentation, but you have to put it in perspective. I have a lot of faith in the continuity of Haxe, not only because Nicholas is a very able developer but also this is an open source community project. It's till a very young project but the progression is really nice. It won't be long and the documentation is there, maybe with your and mine help. The documentation of Adobe is like it's IDE: it has a lot of rough edges. If the Haxe documentation is done in the same spirit of the Haxe technology, I have a big faith this will be adequately dealt with in the near future.

    You also question "what is the killer feature" and you don't see it. For me the killer features are crossplatform, generics, better performance and less verbosity . For me crossplatform is most important. I have projects with all the languages supported by Haxe (and a few that aren't such as moonlight). For me this makes my code base much more maintainable. Generics makes my code more flexible. This is not C++ macro generics, it's real generics. I find the design of Haxe Generics really neat.

    As I said you have a point, but not a very big one. I just take a look in the code if the documentation isn't providing me the required information. This allmost never happened to me. But maybe that's because I have grown accustomed to quickly experiment how stuff works. Haxe is also designed so elegantly and intuitive that this is doable in a heartbeat.

    You write: "Switching to Haxe is going to be a sacrifice for people. They will have to abandon or port old code. They will not be able to interact with libraries like Papervision as easily."

    True, however I think papervision is usable, either by wrapping or by other means. When you write something in Haxe it's performing better and you find it more likely you don't have to port it again. And than there is something about haxe which I think is really neat: it can also generate Actionscript from you haxe code. It will not take that long before there is a haxe port of papervision either, it would really surprise me if it didn't happen. Haxe is much faster, so the papervision community will probably find Haxe very interesting.

  • Levan
    Nov 10, 2009 at 23:23

    sounds like you are as2 developer that can not deal with the fact that AS2 has been depricated, but reality is that AS3 is great language , i if you have ever tried to build infrastructure with as2 be my guest and tell me how, with AS3 its very easy to create a powerfull code infrastructure enforced via Interfaces etc ...

    if you have never worked on reall object oriented languages you will not know ...

    I don't know where did you get it from but AS3 is implementation of ECMAScript4 specification, and its doing a very very good job at it,

    not everything that can be written in 2 lines or less is good, this is the mindset that many designers follow, from development perspective vell defined structure, code performance, and scalability is first and then comes "how many less lines it takes to write something" .
    In general, developers get paid to developer high performance code, which should matter more than to developer code in half of the time that will be twice slower at the end.

  • Nov 17, 2009 at 01:17

    I can't say that as3 is a failure (comparing to as2). Yes, some things like the event listeners in some cases should be easier to write (damn, it just saves time), but, guys, be honest with yourself what would have been your possibilities without the as3?
    The main failure of adobe's imho is that they decided to go into extending the 3D, closing their eyes on the "draw" performance of the FlashPlayer (9,10) and THAT IS the main disaster imho.

  • Smithg47
    Mar 29, 2014 at 09:37

    Very nice! bbadbedafe

Name : Email : Website : Message :