Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best dynamic language to pair with Java on a Java project

What is the best dynamic language to pair with Java on a large Java project?

We are considering using a dynamic language for tests, controllers, services. Some options are Groovy, JRuby or Jython. What are the pros and cons of each for this? Ideally we'd be able to call Java from the dynamic language as well as call the dynamic language from Java.

EDIT: If it helps, we're using Hibernate with PicoContainer and Webwork.

Thanks, Alex

like image 360
Alex Baranosky Avatar asked Oct 08 '10 21:10

Alex Baranosky


1 Answers

There are really three dynamic languages that offer a very seamless interop with Java - scala, groovy and clojure. From there, I'd ask your team which language they would rather work in or have them try a prototype in each language and see what they think.

If the team efficiency isn't important in the beginning, look to what problem each language attempts to solve:

  • Groovy is going to be very loose but natural to experienced Java developers and allows fast prototype development due to it's duck typing.
  • Scala is going to enable you to write DSLs making it a good for frameworks and tools where you want to solve the problem in a language more akin to how you would describe the problem.
  • Clojure is going to impose lisp's functional programming and immutable state concepts and could be a very natural fit for problems in AI, natural language processing, etc.

Finally, I've gone down the path of looking for the perfect language to base projects on and have found there is no perfect language. All of the languages I've mentioned above compile to native JVM byte code and are quite solid. Sometimes you just need to pick a language that might not be as cool as the others but gets you on the way to solving your problem.

like image 100
dhable Avatar answered Sep 24 '22 00:09

dhable