IMO, Flex and FlexJS is all about MXML and AS as the source languages. We, like Dart, TypeScript, GWT and others, are betting on the advantages of writing code in a higher-level structured language to improve developer productivity.
Someone once said that JS is the machine language (or assembly language) of the browser. Low-level languages are closer to the “processor” but are generally unstructured so you can screw yourself over in amazing, but hard-to-find, ways. As I’ve said in my pitch about FlexJS, connecting components together with JS is like assembling furniture from IKEA with only one size of nails. You can connect anything to anything and you’ll make a lot more mistakes. The reason assemble-it-yourself furniture makers use certain connectors that only fit in certain ways is to not only use a better connection, but to avoid folks connecting things incorrectly in the first place. This is the same for a more structured language. Just like C code often allows a block of ASM to be included, I suppose we could allow a block of JS code to be included, but I think we can get quite far without such a feature. And going backward from low-level to higher-level language is always difficult because you can do things in the low-level that don’t map well to the high-level. On 5/23/15, 4:34 AM, "kevin.godell" <kevin.god...@gmail.com> wrote: >Hi Piotr, I had a similar thought pertaining to the interaction with >Cordova/PhoneGap plugins. I think that someone, probably Alex, had >mentioned >the benefits of creating a SWF from the AS would allow for faster and >easier >debugging before sending it off to become html/js/css, which makes sense. >But, I don't think we would be able to test the Cordova/PhoneGap plugins >from the SWF, since they won't exist until the html/js/css is sent over to >Cordova for further processing into the final product. Correct me if I am >wrong. The idea is that the AIR runtime can provide some of the mobile features when testing your SWF, and that you can provide “mocks” for others. Michael Schmalle will also hopefully investigate and find a way to re-use the same native code in both native extensions for AIR and in plug-ins for Cordova. So, sometimes, if you must use mocks, the SWF won’t be able to be put into production, but at minimum, it serves as the place that validates your code and its interconnections to the frameworks and plugins in a more efficient manner. When you convert a third-party JS API to AS, you are allowing the Flash/AIR runtime to enforce that your code is calling the API correctly. -Alex