views:

63

answers:

2

I want to make a business logic of server side Java application as a set of scripts. So I need from a scripting engine:

  1. Maximum Java interoperability (i.e. Spring framework)
  2. Script reloading and recompiling
  3. Easy DB access from scripting language
  4. Clear and simple syntax (some DSL capabilities would be nice to have), easy learning curve for non-hardcore developers
  5. Performance and stability

I had some experience in the similar project with Rhino and it was pretty good. But I want to see if there is something better. Currently I'm looking into Groovy. JRuby and Jython are a bit more complex than I need for this task. Any other suggestion? What to take into consideration?

+4  A: 

Groovy.

Groovy with its builders allows you to build powerful DSLs. All the Ruby guys will say JRuby but the Groovy works the nicest with the java platform.

Groovy also has a big community and seems to get things fixed quicker than Jython or JRuby. The support in eclipse is extremely good.

The only other option I would recommend is Clojure but I like whitespace instead of parens.

And use the Java scripting framework

Adam Gent
Groovy is definitely the way to go for scripted java
Byron Whitlock
A: 

Why not JRuby?

  • Great community contributors like Olabini
  • Superb support in Netbeans and Intellij IDEs
  • Sweetest syntactic sugar like

    cities = %w[ London Oslo Paris Amsterdam Berlin ]

    visited = %w[Berlin Oslo]

    puts "I still need to visit the following cities:", cities - visited

ring bearer