From: Logan Capaldo Date: 2007-01-22T11:17:33+09:00 Subject: Re: Ruby to java or java to ruby converter On Mon, Jan 22, 2007 at 05:16:51AM +0900, Vinod Kone wrote: > hi, > > am a newbie to ruby and was wondering whether there is any ruby2java or > java2ruby converter? we are planning to compare both the languages based > on some benchmarks..so thought a converter would come in handy. any > suggestions? > I think if you want to do this the right way you shouldn't use an autoconvertor. Something written in one language may be written differently in another language in a simpler, more efficient way than perhaps an autoconvertor could detect. e.g.: You might use a block in ruby to iterate over an array. The ruby-to-java convertor would either have to know enough about the running program to determine it was iteration, or it would have to convert the block to an anonymous inner class, which is much more heavyweigth than a ruby block, at least for iterating an array. That's ok because in Java you'd use a for loop anyway. Something you might do with mixins in Ruby you might do with inheritance in Java, etc. Despite the both of them being OO languages, the idioms used are different and your convertor (unless you've got some AI hidden away) is not going to be able to convert them properly. > thanx, > vinod > > -- > Posted via http://www.ruby-forum.com/.