Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert javascript to dart using frog?

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

like image 230
JayDee Avatar asked Feb 20 '23 12:02

JayDee


2 Answers

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

like image 139
Chris Buckett Avatar answered Feb 23 '23 18:02

Chris Buckett


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.

like image 31
Lars Tackmann Avatar answered Feb 23 '23 19:02

Lars Tackmann