javarubytranslation

Conversion of Ruby-Sourcecode to Java-Sourcecode


I need to translate ruby-source code to java-source code. During my searching phase i found this website: https://varycode.com/

The problem: This website is provides only this way of translation JAVA > RUBY but I need this RUBY > JAVA

Hope some one can help me otherwise I need to convert 50 classes of ruby by my own =(


Solution

  • You don't want to do this. And you can't. At least not if you expect the outcome to meet some quality standards.

    If you write Java code, then write it the Java way. If you write Ruby code, then the Ruby way. There are lot of features that do not translate well into Java (and vice versa). While it might be easy to translate your basic "HelloWorld" example between the two languages, it becomes harder when you have stuff like

    If you write Java directly then you can make use of stuff like method overloading, or interfaces that do not exist in ruby.

    In the end it is all about writing IDIOMATIC code so you can use the full power of the language.

    So you will have to bite the bullet i'd say. If you really need to translate them actually. What is the reason you want to translate the classes?