Is there an automatic converter of javascript code to Dart? Or is it too soon?
问题:
回答1:
There's a recent tool called JSParser and does all its magic using Dart itself, that is the parser is written in Dart.
On a related noted there is Frog (and it comes with the standard SDK) which converts Dart to Javascript, it's also written in Dart making it a good showcase for the language.
回答2:
Probably too soon.
I believe Dart came out earlier this week. As some of the others have mentioned, there might never be a converter for JavaScript->Dart. I asked another question if it was/will be possible to call JavaScript code from Dart, there is no official answer on this. Another thing I have heard someone ask for on Google Plus is a CoffeeScript->Dart translator. I don't know what the feasibility of this is, but would be a nice way to stick with the more traditional environments, until Dart can be adopted.
回答3:
Angular 2 team is building one.
Why isn’t Angualr 2 just built in Dart?
Answer: the Angular folks want to deliver a great framework for BOTH Javascript and Dart.
Dart generates great Javascript for browsers, but we have work to do to generate reusable Javascript libraries.
The Angular team needs to generate reusable Javascript libraries.
quoted from http://work.j832.com/2015/03/angulartsjsatdartwtf.html
Their Javascript (Typescript) to Dart transpiler can be found at https://github.com/angular/angular/tree/master/tools/transpiler/src