On 11/7/13 10:27 AM, "OmPrakash Muppirala" <[email protected]> wrote:
>On Thu, Nov 7, 2013 at 8:56 AM, Erik de Bruin <[email protected]> wrote: > >> Well, I figured that if we have structural parity between the two >> frameworks, several things will happen: >> >> - type checking becomes consistent: as soon as there is a different >> inheritance/implementation chain on the JS side, things go >> pear-shaped: how about 'myClass is Sprite'? >> > >+1 >On the JS side, it should not cost us anything to have this kind of class >inheritance hierarchy parity, right? Are we worried about performance in >case of too much prototype chaining [1]? Download size as well. Internally, the AS side should be able to take full advantage of Sprite, but we don't want the public API to be littered with all of Sprite, otherwise we're back to emulating FP in the browser. I was thinking of teaching the compiler to warn or error about certain Flash API usage in certain classes. > > >> >> - the frameworks will become easier to develop and maintain: build it >> on the AS side, and start the work on the JS side by copying the class >> structure. Or better yet, run the AS through the compiler and start >> with the JS output, that way you should be able to start with a >> reasonable functional JS class ;-) This is really cool, by the way. I >> put the entire AS framework through the compiler the other day and was >> amazed at how clean and nearly usable the JS output was... it got me >> thinking if we wouldn't want to just do the AS side (FlexJS style) and >> then see what's missing on the JS side (mostly flash.* classes, >> apparently). But that's for another time ;-) >> > >Big +1 for this idea. If there is any chance I get to not write >JavaScript >directly, I want to make full use of it. Any chance you can publish your >process for doing this? As an overly simple example, if I write a Chart >component in AS, it would be so much easier if I go and replace the AS >'graphics' object to a JS 'canvas' or 'd3' object. Most other stuff >should >(hopefully) remain the same. Might work for some Charts, but if a chart needs clickable-moveable pieces, it may need to be constructed out of Divs on the JS side.
