Reputation: 959
Someone on this site mentioned that it was possible to use frog to convert javascript to dart. I gave it a try but was unsuccessful.
what is the detailed procedure to convert javascript to dart with frog?
thanks
Upvotes: 5
Views: 2835
Reputation: 6025
Just thought I'd mention that [Google themselves released an official JavaScript-to-Dart app/library known as 'dart-synonym'. The AppEngine code and core JavaScript libraries are available on GitHub
Aaron Wheeler and Marcin Wichary from Google outline it in this blog post.
Upvotes: 1
Reputation: 20885
Update: turns out Florian from the Google Dart team made a proof of concept of a JavaScript-to-Dart converter.
This is not possible. What is (or soon will be) possible is for the Dart JavaScript compiler to self host, meaning that you could compile the compiler to JavaScript, embed it into a web page and compile Dart dynamically to JavaScript on the fly. This will also make the DartBoard much more interactive, unlike the current edition which executes your Dart code server side.
Upvotes: 3
Reputation: 14398
Florian Loitsch (from the Google Dart team) created a JavaScript to Dart parser at the recent London Dart Hackathon.
Code: http://code.google.com/p/jsparser/
Announcement (quoted below): https://groups.google.com/a/dartlang.org/group/misc/browse_frm/thread/4d7af7aec81f2ac4#
I spend a little bit of time during this weekend to make it more complete and usable, but don't expect a polished product. For example there are no tests, yet.
That said: I do think that the library is in a usable state. I also tried to keep the code simple (even if that sometimes meant sacrificing some speed), and I hope that this alone makes the library valuable.
My motivation for the parser was to help in (semi) automatic translations from JavaScript to Dart. Currently I don't have the time to continue on this path, but maybe somebody else wants to give it a try?
-Florian Loitsch
Upvotes: 4