Convergence options for Ecmascript/Actionscript?

Brendan Eich brendan at mozilla.org
Tue Aug 28 17:30:27 PDT 2012


Claus Reinke wrote:
> Hope this isn't politically inappropriate here;-)
>
> 1. Flash is dying as a browser plugin, but otherwise still alive,
>    especially with compilation of Actionscript to native code [2,3].
>
> 2. Adobe has been growing support for HTML/Javascript options.
>
> 3. Actionscript is based on an old ES draft standard that failed to
>    reach consensus, partly because its changes were considered
>    too much at once. [my impression - I don't have a reference]

You really should read back in es-discuss if you have time (understand 
if you don't!). We covered what made ES4 fail. The main problem was 
namespaces, upon which packages were built.

Unfortunately, AS3 uses namespaces and packages heavily. Mozilla's 
Shumway project includes an AS3 bytecode recompiler that generates JS, 
and we cannot lower namespaces to anything native and JIT-optimized in 
JS itself. Cc'ing Tobias in case he can comment.

> 4. Lots of Actionscript developers find themselves having to
>    grow accustomed to the world of HTML/Javascript

Developers do adapt, of course.

> One consequence of 4 are blog posts about "Javascript technology
> X, for Flash developers". When I read such blog posts (eg, [1], with
> side-by-side comparisons of AS and JS code), I get the feeling that
> the transition would be much easier from AS3 to ES6, where things
> like modules and minimal classes exist. There is an opportunity here,
> if those parts of the standard are sufficiently stable to recommend
> transpiling (until real ES6 implementations come along).

Namespaces and packages are the problems (really one problem, namespaces 
making lookup three dimensional rather than two dimensions (proto and 
scope chain).

> One consequence of 3 is that there should be a vibrant community
> of AS developers who have practical experience with features similar
> to those considered for ES6, in a Javascript-like language.

Not similar enough, in my view. Not only does AS3 have namespaces, it 
uses them for class-private and IIRC protected visibility. IIRC AS3 
classes do not have class-side inheritance (just like Java), another 
difference.

Finally, AS3 was really intended, along with an implicitly early-bound 
namespace, to statically judge the meaning of names and even types. Its 
code loading and global object model is entirely unlike the Web's.

> Yet I
> do not see any experience reports or spec feedback based on that
> here on this list. Wouldn't it be very helpful to invite such input?

I think not. Some of us were involved intimately in ES4. We have the 
scars and remember the differences. ES6 does not need more constraints 
or feature demands from newcomers. That is a sure way to kill it.

> I don't expect Actionscript developers want to lose any of their
> language features, but there might be profit (for both AS and ES
> developers) if Adobe could try to align AS4 to ES6 so that the
> common language subsets have common syntax and semantics.

That's up to Adobe, but I recall that they are talking about going more 
their own way:

http://www.kirupa.com/forum/showthread.php?371078-ActionScript-quot-Next-quot-Flash-Roadmap

> Such a hypothetical AS4 would be a typed version of ES6, making
> it easier for Adobe's tools to support both, and making it easier
> for developers to use or maintain either.

No typed (static) version can work interoperably and soundly with the 
dynamic language. This was one of the conclusions of the ES4 work. How 
to interface typed and untyped (dynamically typed) code is still 
research. Sam Tobin-Hochstadt's Typed Racket work is one example of 
research along the lines of interconnecting dynamic and static code 
without losing soundness.

Even throwing out soundness may break interop. We'll see how this works 
for Dart, but right now Dart is a dynamic language with an early warning 
system.

> Are there any Adobe folks listening here? Does anyone have the
> contacts to raise the question with them? Do you agree that there
> is potential for useful exchange of information and joining of
> efforts if the wall between AS and ES could be lowered?

Adobe folks departed the Ecma TC39 field, although IIRC Adobe remainds a 
member of www.ecma-international.org.

Again I must comment that ES6 wants no new constraints and pressures. 
Scope creep is the enemy.

Also, you should not ignore the ES4 lessons learned or assume the 
problems were not material and inherent to the divergence between AS3 
and ES3.

/be



More information about the es-discuss mailing list