My history behind the AS3 language

Back in the 90’s, I started to work with MochaScript which then got named JavaScript, and later on, something called “Dynamic HTML” or DHTML arrived.

From there, you got the browser war, you had to pick up a camp:
Internet Explorer vs Netscape, and about that time Flash came along.

At the time I was the webmaster for MSN info (France) and here what happened: Microsoft told us to use that new thing ShockWave Flash instead of GIF for some little bit of advertising that needed to be more interactive.

At that point, I was with my fresh copy of Macromedia Flash v3 (maybe 2?), and forced I had to learn Flash. It was OK’ish, the vector things were cool, but the programming part were horrible, in fact there were no programming language, more like some actions you could add this and there (eg. tell target to do this or that, gotoandplay there, etc.).

And the years passed, Flash v4, Flash v5, and there suddenly you could use a programming language based out of ECMAscript and named ActionScript. I immediately jumped on it even if not all things were ideal (no events, no try/catch errors), because I knew JavaScript I could easily work with that ActionScript.

And greatest feature of all: it would work the same in IE and Netscape.

Then, when Flash v6 came, there I was really hooked up: they added events and try/catch errors. And so I kept using it and learning more of it etc. for each new version: 7, 8 ouh ActionScript 2.0 now, 9, 10, etc.

ActionScript 2.0 was basically what JS developers have now,
underneath the code was still AS1 but you had this syntactic sugar on top to make the language more structured and allow the compiler to catch errors early.

But the real kicker was with v9, in the mean time Macromedia has been bought by Adobe, and here in 2006 we suddenly had this new virtual machine and a new ActionScript language: basically AVM2 and AS3.

At the time, a lot of dev complained, they did not want to use or even learn AS3, they wanted to stick to AS2, me it was kind of the opposite, after being on the C# beta and having learned couple of other languages I really embraced AS3 completely from the get go.

That to explain why (probably) Adobe did not forced a move to ActionScript 4 in 2014, because they remembered 2010 (4 whole years after AS3 was available) you could still find dev who did not want to hear about AS3 and wanted to stick to AS2, and in 2010 we also got struck by “Thoughts on Flash”, not being able to run Flash on iOS , a catastrophic “doom of Flash” bound to happen right ?

And here Adobe had a stroke of genius, they already had AIR (Adobe Integrated Runtime) and they made it work in such a way that you could cross-compile a SWF to generate a binary (IPA) for iOS.

I was on the Gemini beta, the project that preceded AIR, AIR 1.0 was great but same as Flex, Adobe did not really market it well from the beginning eg it was an “adobe integrated runtime”, which basically were speaking to no-one except geeks like me who knew the potential of AVM2+AS3 on the desktop.

But if you look at how Adobe evolved its own presentation of AIR, they stopped to call it just “air” but “Adobe AIR” and started to talk about OOB experience.

Wait … OOB what ?
Out Of Browser experience
simply put: it’s like all the things you love in Flash but it works outside the browser

So, long post, in fact long intro to what I want to say about improvements of AS3.

ActionScript 3.0 in itself is nothing, it is a good well balanced language, imho right in the middle between Java and JavaScript, which can work with different style of programming, from the strong Object Oriented Programming to the more lose Prototype Programming.

But AS3 is nothing by itself, you need to add 2 things to make it great

  • AVM2
  • the Flash API (or at least a good API)

AS3+AVM2 is almost by itself a killer app, it’s not only the language but also the VM that goes with it, it can compare head to head with

  • the Java language and the JVM
  • the C# language and the CLR

Read Comparison of C Sharp and Java

So you take AS3+AVM2 and to that you add the Flash API,
remember the long intro, that’s where I use it :slight_smile:

When we moved from AS1 to AS2, we were able to keep using the same API, but improved over time, but still … the same API.

Same, when we moved from AS2 to AS3, Adobe kept around the same API, they adapted it to work with AS3, events, etc. but you could still use the same API and yeah that is very important.

If you can compare the AS3 language to Java and C#,
and then compare AVM2 to JVM and the CLR
then you could compare the Flash API to the .NET framework and the Java Class Libraries.

And it’s here where I say: we don’t really need any AS3 improvements at the language level.

Wether you have an “abstract” keyword to define abstract classes etc. or not, does not really matters.

Oh I know a lot of dev would be all over it “oh no!!! we do need abstract classes, because of this and that otherwise we can’t do blah blah blah”.

No you don’t, it’s not because you have an abstract keyword that suddenly you gonna be able to do things that were not possible before, it’s just code architecture, it’s not gonna make you code better or faster or solve problems for you magically, stop being a baby.

It’s like a C dev who would say “oh sorry no pointers? well I can not work with Java”, it’s ridiculous.

But yeah for some AS3 dev they want generics, abstract, and tons of other stuff that they found in other languages like Java and C#.

Except, those things they get added over time (eg. they were not available from v1), and now if you talk about C# or Java you HAVE TO mention the version, otherwise you don’t know which language you are talking about

see Java version history
and C# versions

I can guarantee you that working with C# v1.0 vs C# v4.0 is a very different thing, it is called C# but the whole thing feel like a different language, and same goes for Java v1.6 vs Java 1.8, they both are very different beasts.

Now look at our ActionScript history

  • basic actions “commands”
  • ActionScript v1.0
    very similar to JavaScript/ECMAScript
  • ActionScript 2.0
    class based sugar syntax
  • ActionScript 3.0
    tons of things from class/interface
    to namespace and other advanced things

what is the constant?
the Flash API

it always been there, been improved and matured over time
and with a nice versioning scheme (not ideal but good enough) linked to the SWF version (eg. the level of API available).

if you had a project made for AIR 1.0
and want to improve it and move to AIR 20.0
what changes really ?

Your API, but not the language, or very few of it
from AIR 1.0 to AIR 20.0 that’s 19 different releases in between

do you have to rewrite your whole AS3 code?
nope

can you improve the existing code with new API ?
yep

This is why I say you don’t want ActionScript 3.0 language improvements because the language in itself does not really need them.

You may need more API functionalities but that’s about it.

In fact, if Adobe were to ask for change in the languages I will probably vote “no”, unless those changes add new things without breaking old things.

Read: I don’t want to learn a whole new ActionScript language.

I can learn new API, new features, but no way I learn a whole new language, if I wanted to do that I can move on to tons of other stuff.

You see, that’s my point of view, you have the “long intro” history to understand where I come from, but anyway this kind of thing will always be very biased.

Now, if you want a little fun :wink:

tell me about one AS3 language feature you are really missing and why,
you know, a reasonable argument for it

and I’m pretty sure I can show you why this feature is not really needed

go ahead bring me your best argument about abstract classes, enum or whatever, I dare you :smile:

9 Likes

I think the biggest reason for AS4 was to improve performance. I would welcome Float if it meant that my app would run faster.

I agree about the improvement path that was taken. I like that the same code from AIR 1.0 will run in AIR 20.0. Any syntax or language features that would improve performance I would welcome as long as previous code still ran.

Minor necessary changes would not be a problem if the compiler was able to give feedback. I didn’t like all the changes suggested in the original AS4 prototype. I think they were trying to remove namespaces. I don’t understand how they would be able to support the basic public, private and protected namespaces but not support mx_internal and other custom namespace, etc.

I wasn’t happy with Vectors syntax. I mentioned this on the beta forums but in the end it was added. But I don’t have to use it.

I would have like method overloading. Abstract classes would have been very simple to add. You just apply a few of the interface rules.

If a language feature was added it wouldn’t necessarily require Adobe to make changes to the runtime. The compiler could convert some language features.

For example, method overloading:

function getPerson(name) {
     // method 1 stuff
}

function getPerson(name, age) {
      // method 2 stuff
}

Could be rewritten:

function getPerson(...args) {

    if (args.length==1) {
         // method 1 stuff
    }
    else if (args.length==2) {
          // method 2 stuff
    }
}
1 Like

the method overloading example is, sorry, not the best one, but let’s go with it

if I had something like

function getPerson(name) {
     // method 1 stuff
}

function getPerson(name, age) {
      // method 2 stuff
}

then it’s a no brainer

function getPerson( name, age = null ) {
      // test if age is present or not
}

I would say method overloading is more a problem like the following

function getPerson( name:String ) {
     // method 1 stuff
}

function getPerson( age:uint ) {
      // method 2 stuff
}

which you can solve by indirection, for example

public function getPerson( any:* ) {
     if( any is Number ) {
         _getPersonByAge( any as Number );
     }
     else if( any is String ) {
         _getPersonByName( any as String );
     }
}

private function _getPersonByName( name:String ) {
     // method 1 stuff
}

private function _getPersonByAge( age:uint ) {
      // method 2 stuff
}

or even use fancy namespaces

namespace age;
namespace name;

public function getPerson( any:* ) {
     if( any is Number ) {
         age::getPerson( any as Number );
     }
     else if( any is String ) {
         name::getPerson( any as String );
     }
}

name function getPerson( name:String ) {
     // method 1 stuff
}

age function getPerson( age:uint ) {
      // method 2 stuff
}

but really I don’t see method overloading as something super important, because what does it really cost to add/rename a new method ? not much

function getPerson( name:String ) {
     // method 1 stuff
}

function getPersonByAge( age:uint ) {
      // method 2 stuff
}

here even with 2 “clean” public methods I’m pretty sure the grunt work would be done by a private methods

In fact, using just interfaces you could come up with even cleaner design

function getPerson( entry:IData ) {
     entry.getData();
}
NameData implements IData:
AgeData implements IData:
// etc.

this kind of interface dispatch would allow to search by name, age or any other type of data in the long run, but with a “flaw” getPerson( entry:IData ) is imho less readable than a simple getPerson( name:String ).

All that to insist on my initial point:
to have or not “method overloading” does not matter at all

it’s not like AS3 is not expressive enough to write the code to solve that kind of problem.

Despite not having method overloading you can still architect and design a nice solution :slight_smile: .

7 Likes

If you digg a bit in the source code of Tamarin / avmplus you could see that there were plans to support the float type, also abstract classes, if you also add the hacks that was required to implement Vectors,
and even if I have no proof it’s probably what lead Adobe to research ActionScript 4.

Personally, AS4 I did not like it at all, it was half-baked imho here my main grief

  • only for the sake of performance
    we were losing a lot of AS3 expressivity
  • but even with perf in mind
    apparently they were no plan to cross-compile
    AS4 bytecode to native code
  • in short AS4 and the AVM3
    would have been mainly an AS3+AVM2 rewritten
    to get more perf and to lose language feature
  • with the big downer that
    nothing was planed to be open sourced

If I had one thing to ask to Adobe about perf that would be to do
the same thing they did for Adobe AIR cross-compiling to iOS, to every possible other targets: Android, Desktop, etc.

It is possible, it is a huge work but still possible, I could even argue
that it would be less work than to rewrite a new AVM with a new AS4 language.

1 Like

I started with Flash 4 and I quickly fell in love with the possibilities and “crossbrowserness”, which was BIG pain these days. I remember the “plugin wars”. These were crazy times… I would compare it to the Wild West :wink:
Fortunately, the champion has emerged from this chaos… its name was FLASH!

When as3 came out I was very skeptic about it, because I had to rewrite everything done earlier. Fortunately I did the switch around 2008 and build big historical site about Nowa Huta, the place where I live. It is still available here:

http://nhpedia.pl/

I never looked back to AS2, when I learned and harnessed AS3! It was a breeze and pleasure working on that. We could do everything, our creativity allowed at that time. It would be impossible to create the same 8!!! years ago with JS, or would take 10 times more, because of the heavy use of interactive media, videos, animations and sounds… and we know that FP is a king here.

Te best part is… that Flash has never been that powerfull as is now, allowing real, 100% crossplatform, mobile, desktop and SERVER! development. Add ANEs to it and you can do whatever you imagine with one code base :wink:

Flash has just survived another browser war, which I would call “HTML5 hate era”… but only on desktops…which is fair enough. All browser will soon adapt PPAPI and we are save for another 5+ years at least.

Lets leave making bullshit ads and html widgets to all these HTML5 zealots…someone has to build this garbage anyway :wink:

We should focus on serious apps and games instead, because this is where we have been for years.

Thanks for creating this forum zwetan! It looks and works awesome.

Regards

3 Likes

I recall that the first builds Adobe planned to share with the pre-release users were going to be AOT-only. No JIT until later builds. Maybe that meant we’d only be able to target iOS for while, but I suspected that it meant we’d be getting the option of AOT for other platforms too. Unfortunately, we never got the chance to try any builds, so I can only speculate. :disappointed:

My story behind AS3 would be the shortest. I learned it because they stopped adding good stuff to AS1/2

1 Like

Someone also had to build this fancy discuss board that you are using to post this insult… just saying :wink:

1 Like

I’m really happy with the current state of AS3. But if could add one single feature to the language, it would be generics.

I know they are not required, I have been used the language for a decade now and I’m still alive! But every time I design an API that requires end-user to manually cast an object, I’m always a bit sad. Mainly because I know that I would not have to do it with generics. I do not miss the pre-java 5 era, pretty much like I do not miss the days of AS2!

1 Like

I touched Flash stuff from Flash 6. From animating to coding. So, I also learned Flash from AS1, 2 to AS3.

The first book which I read to learn prototype-based OOP and easing equations of tween engine with ActionScript is Robert Penner’s Programming Macromedia Flash MX, very impressed, this book let me know what is the cool part of Flash. And then, the another book Foundation Actionscript 3.0 Animation: Making Things Move!
(by Keith Peters)
is worth reading too. They also made me realize how to use Flash on the right place.

I formerly worked with AS3, developing games on display kiosks, on website, widgets, RIAs etc. and sometime playing on wonderfl. But now I am using JS, yea, life is hard :sweat_smile:

I agree with @zwetan 's point. If we only talk about the language itself. AS3 is good enough to do much work. Some other languages would result in over-design while adding more and more new features. Some features are not using all the time, even never being used. Flash without growing that much is not too bad. It should be in conformity with KISS or Minimalism principle. The design of Flash API is not perfect but complete. But as you see, in JavaScript’s world, ES6 is not the end :wink:

But if we think about the language with platform. AS3 on the FlashPlatform is fit for Game Loop or just call looping while JS on the Browser is fit for GUI. If one JavaScript(I say HTML5) is going to rule them all, it must reinvent the wheel. As we get it now, I do not explain anymore.

Looks like As4 is Haxe, which is again evolved from action script and language is evolving,…

Haxe and AS4 have nothing in common

1 Like

Zwetan, thank you for setting this site up (just joined) and thank you for providing your long-winded history with the Flash platform - I tend to be very verbose myself :wink: Seriously, it was great to have as many flashbacks as your story just gave me and I’m really hoping the efforts behind the community supporting this site returns some righteous recognition to this awesome platform - regardless of the years of industry FUD since 2010 brother!

3 Likes

I’m too verbose true, guilty as charged :smile:
thanks for the kind comment brother

1 Like

I mis-read renevogtlowell as revengeofthetowel

3 Likes

:slight_smile: Definitely going to tweet that later :slight_smile:

I thoroughly agree that the AS3 language is not lacking. I love working with it.

About my only issue with it, and it’s a minor one, is data type inconsistencies. Data types are capitalised, except int, uint and void.

Arguably a blessing, data types also aren’t very strict. Going from Number to Int and back again without explicit conversion, is no big deal.

AS2 was brimming with inconsistencies and when AS3 came along, the initial hurdle of learning it was quickly overcome when I discovered how beautifully consistent it was by comparison.

One of the key differences between Haxe and AS3, is further consistency again and strict data types. In that sense, it feels like it’s on the same path from AS2, to AS3, to Haxe. May not be AS4, or even resemble what AS4 was planning to be, but AS4 isn’t here and Haxe is.

but AS3 is still there
and imho does not need to be replaced by AS4

programming languages evolve but I would say not all upgrade is worth it
as much as moving from AS1 to AS2 to then AS3 made sense
moving beyond that is a bit unnecessary because really what is crucially missing ?

nothing

there is nothing I can not write in AS3, period
the language is mature and evolved enough to write about anything

so yeah some people can whine about missing a specific language feature like enums or abstract classes and other generics, but really does those missing features prevent you to write your code ?

no

but for many years there has been this thing that a bigger version number means better

you have seen it in programming language with Java and .NET

you have seen it also with browsers with Chrome v57 vs Firefox v52

and now we see it again with JavaScript, from ES3 to ES4 to ES5 to ES6 (ES2015) to ES2016 (ES7) to ES2017 (ES8)

let’s put a big number after our programming language to show that we mean business, LOL it is really that ridiculous

technically nothing prevent a bunch of dev to invent
ActionScript Absolum 2020
put a cross-compiler behind it that target AS3/AVM2 under the hood and let’s call it the day “yay we have the absolum 2020 language that doom them all” :joy:

You see up there ES4, why is it crossed out ? why it has been abandoned ?

it’s because the changes from ES3 to ES4 were too radical
it’s because those kind of changes work better with a runtime that support them

and guess what ?
we already got that with AS3 and AVM2

what the browser ecosystem rejected back in 2006 worked pretty well for another ecosystem: the flash platform

but you don’t need or want those radical changes every year, that would be too maddening (well… poor JS dev this kind of madness is what is happening to them)

Once you have something like AS3, the only other things you may need is more native libraries or AS3 libraries, but more language features ? nope

it’s not perfect, it never will be perfect because we as a collective still have not figured out “programming”, but it is good enough to write the code we need.

1 Like

I can’t agree more. I have used quite a lot of (“advanced” they say!) language features like generics, but in the end… it doesn’t matter for me as I always go with Vector.