java2dart: Enquiring minds want to know...

997 views
Skip to first unread message

Kevin Moore

unread,
Jan 14, 2013, 10:37:09 AM1/14/13
to mi...@dartlang.org
https://code.google.com/p/dart/source/detail?r=16998

Just curious if there is a specific scenario in mind: JWT conversion? Others?

Ladislav Thon

unread,
Jan 14, 2013, 12:13:18 PM1/14/13
to General Dart Discussion


> https://code.google.com/p/dart/source/detail?r=16998
>
> Just curious if there is a specific scenario in mind: JWT conversion? Others?

Translating Dart Editor together with Eclipse RCP to Dart, running it in Dartium and using it as an end-to-end benchmark? :-)

LT

Doug Dew

unread,
Jan 14, 2013, 2:24:12 PM1/14/13
to mi...@dartlang.org


On Monday, January 14, 2013 9:37:09 AM UTC-6, Kevin Moore wrote:
https://code.google.com/p/dart/source/detail?r=16998

Just curious if there is a specific scenario in mind: JWT conversion? Others?

I have to work with SOAP and so would be interested in using java2dart to convert something like Axis to dart. 

Brian Wilkerson

unread,
Jan 14, 2013, 2:44:31 PM1/14/13
to mi...@dartlang.org
Kevin,

Just curious if there is a specific scenario in mind: JWT conversion? Others?

Yes. The Java to Dart translator is being built by the Editor team, which is also the team responsible for the command-line analyzer. One of our longer term goals (but hopefully not too long) is to port the command-line analyzer to Dart, which would make all of the development-time analysis it provides be more directly available to tools written in Dart. We are writing the translator as an experiment to see how hard it would be to automate at least part of the process of porting our code to Dart.

We don't have any lofty goals beyond that. We don't plan on writing a tool that will translate every possible Java construct; it will almost certainly be limited to the constructs in our code base and might not even translate all of those. And, of course, syntactic translation isn't even the hard part. The hard part is semantic translation: translating the use of other code (including the uses of classes in the JDK) into Dart equivalents. I don't know how far we'll even attempt to go in that area; so far we're just getting started with the syntactic translation. As I said, so far this is just an experiment, and if it doesn't go well it might get dropped completely.

That said, we are not opposed to making the tool do more (or, perhaps more importantly, having contributions from the community to make it do more). We're just limited, like everyone else, by having a finite number of hours in the day.

Brian

Ahmet A. Akın

unread,
Jan 14, 2013, 2:47:51 PM1/14/13
to mi...@dartlang.org
On Monday, January 14, 2013 5:37:09 PM UTC+2, Kevin Moore wrote:
https://code.google.com/p/dart/source/detail?r=16998

Just curious if there is a specific scenario in mind: JWT conversion? Others?

My guess is that not only current java libraries, but especially GWT and Android would be good targets for this. Because their API is controlled by Google. I like this. 
 

Rob Becker

unread,
May 19, 2013, 5:42:04 PM5/19/13
to mi...@dartlang.org
Brian, any updates on Java2Dart? It would be super to be able to convert java libraries into Dart (I was thinking of iText or similar)

Brian Wilkerson

unread,
May 19, 2013, 6:22:50 PM5/19/13
to General Dart Discussion
Rob,

Brian, any updates on Java2Dart? It would be super to be able to convert java libraries into Dart (I was thinking of iText or similar)

Our goals for the tool haven't really changed. We are using it periodically to keep the experimental analyzer code up to date, and we are occasionally making improvements in the generated code so that it's (slowly) becoming more idiomatic Dart, but at the moment most of our energy is focused on M5: getting the new analysis engine up to the same level of functionality as dartc (in terms of generated errors and warnings) and getting the remaining Editor features ported over to the new engine.

Brian

kc

unread,
May 20, 2013, 1:28:17 AM5/20/13
to mi...@dartlang.org
On Monday, January 14, 2013 7:47:51 PM UTC, Ahmet A. Akın wrote:

My guess is that not only current java libraries, but especially GWT and Android would be good targets for this. Because their API is controlled by Google. I like this. 
 
This makes sense - as it shows that Google is thinking strategically. "We have problems with Oracle - and really need one runtime/libs across our Chrome and Android platforms. Lets make it possible to port Android code to Dart".

But I don't think this is the case. If it were the Dart libs would look much more like the Apache Java libs used by Android.

Dart is funny - it's moved away from Java - but not far enough. And it doesn't look like JavaScript (especially when ES6 comes out).

K. 

Brad Pillow

unread,
May 25, 2013, 4:53:46 PM5/25/13
to mi...@dartlang.org
Is there a pre-built version anywhere I can play with? I'm hand converting some Java to Dart now and I am sure Java2Dart would save me quite a bit of time even if it's not ready for prime time.

Steve Hamblett

unread,
Oct 11, 2013, 6:36:06 AM10/11/13
to mi...@dartlang.org

A more general purpose tool would be better, I'm thinking of wsimport to parse a wsdl, this could convert the java classes to Dart for SOAP bindings etc. until we get 
a native wsimport that is.

Brian Wilkerson

unread,
Oct 11, 2013, 9:54:20 AM10/11/13
to General Dart Discussion
Rob,

Sorry for the long delay. I completely missed your question.

Brian, any updates on Java2Dart? It would be super to be able to convert java libraries into Dart (I was thinking of iText or similar)

We have continued to improve the translator, and we continue to use it, but our basic purpose for it hasn't changed.

I'm not familiar with the implementation of iText, but it would be interesting to hear about any experiences people might have in using the translator. And, as I said, if you run into any problems we're always happy to take contributions that will improve it.

Brian
Reply all
Reply to author
Forward
0 new messages