>From Roland; "If so, beware, you're gonna run into trouble. Not all TS language features can be translated into Actionscript. One of Mike Labriola's employees spent quite a bit of time writing a parser/generator a while back, since we had the same plan for Randori. But in the end they abandoned it, since TS and AS just couldn't be matched up correctly."
"The main problems were method overloading and optional members. An interface in TS doesn't necesarilly HAVE to be implement completely by a class, by adding a question mark to the declaration you make that member optional." "I think they bumped into more such problems. Again the problem here was that implementing this for the first 90% was dead easy, but after that we ran into serious insurmountable problems. That is basically when we abandoned the whole thing because at the same time there was just practically zero interest from the community in Randori..." In typical Roland fashion, he recommends that I use an evolving TypeScript for my projects. :) Mike On Mon, Jun 1, 2015 at 9:31 AM, Alex Harui <aha...@adobe.com> wrote: > > > On 6/1/15, 5:39 AM, "Harbs" <harbs.li...@gmail.com> wrote: > > >I believe what you say, but out of curiosity, what about the conversion > >was the deal-breaker? > > I suspect the 10% where TS doesn’t map cleanly to AS. > > FWIW, it was never clear to me that the SWCs to represent popular JS > frameworks could be completely auto-generated. It would always depend on > whether everything in their API surface was truly object-oriented or > whether it relied on something you could only do in JS. So even a tool > that gets you 90% there might be very helpful. > > A few other ideas on this topic: > 1) Since TS is a high-level language, it may not map as cleanly to AS as > the JS it generates. I pondered whether there was a way to get the d.ts > to output to JS and work from there. > 2) I believe that some popular JS frameworks have an externs.js file that > Google Closure uses. These may also serve as a starting point for > generating an AS API. > > In an earlier post, Mike mentioned Jquery and some method overloading. I > would think that at the JS level the methods either cleanly map to a > single method with optional args or they are just doing AS overloading > where the parameter type is Object and testing the type inside the method, > but problems like these also need to be handled in creating the AS > definition. > > -Alex > >