Convergence options for Ecmascript/Actionscript?
Brendan Eich
brendan at mozilla.com
Sun Sep 2 20:27:42 PDT 2012
Peter van der Zee wrote:
> On Wed, Aug 29, 2012 at 2:30 AM, Brendan Eich<brendan at mozilla.org> wrote:
>
>> 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.
>
> Fwiw, in our as3vm we solved the namespace problem by prefixing all
> properties with a namespace and an arbitrary separator (that would be
> illegal in regular identifiers).
That does not work in general:
// function code here...
use namespace N1;
use namespace N2;
return obj.prop;
You can't always tell statically that prop is N1::prop in obj, or
N2::prop, or an unprefixed property. At least, not in ES4 as drafted
based on AS3.
> But there are more issues in "as3 vs
> es" than namespaces. For example: implicit instance closures (x=a.foo;
> implicitly binds x to a)
Yes, good one!
> and that pesky `"foo" === new String("foo")`
LOL, I'd banished the memory of early ES4 (2nd try, 2006) wishing to
unify primitives and their wrappers. Thanks (not :-P) for reminding me.
> So I agree with the sentiment that ES won't easily (re)connect with
> as3. Especially when Adobe is working on an as4 that's even more
> disconnected (as Avik mentioned above). And that's their prerogative,
> obviously.
Agreed.
Also I agree with what Taka points out: trying to ask various AS3
developers what they want from JS is counter-productive.
/be
More information about the es-discuss
mailing list