views:

80

answers:

2

Whats the fastest/best scripting language/API that is available that can be integrated into Java applications.

Is there any Java bindings for Google's v8 JavaScript engine?

Defining fastest as in raw processing speed, e.g. how many times a script can be run in a second using a relativity high number of language features.

Defining best as in how the languages features stack up against other languages (OO, strong/loosely typed, etc), and how easy it is to integrate into a Java application.

A: 

Scala is perhaps the fastest, being relatively close to Java. Which also mean it is relatively easy to integrate.

Tom Hawtin - tackline
Scala looks to be an alternative to Java, IE being compiled to byte code and run on the Java VM. I could not see anywhere that It can be used as a scripting language, IE being interpreted/compiled and run by a Java application.
Petah
@Petah *boggle*
Tom Hawtin - tackline
+1  A: 

Lookout for these:

  • JRuby (Ruby for the JVM)
  • Jython (Python for the JVM)
  • Rhino (JavaScript for the JVM)
  • BeanShell (originall intended to become the standard scripting solution in Java, but widely superseded by external efforts)
  • Groovy

Then there are other languages that are not exactly "scripting" languages but that can be called from and interact with your Java programs:

  • Scala
  • Clojure

Considering your requirements for "fastest/best", I'd recommend you actually get into Scala or Clojure instead of a scripting alternative. That being said, it's really dependent on context. I found JRuby or Groovy to be often performing well enough. You can find many other SO threads to help you with your research, like this one: http://stackoverflow.com/questions/1314732/scala-vs-groovy-vs-clojure

(Also, if you are looking into using JavaScript as a server-side language, have a look at efforts around CommonJS and Node.js, for instance.)

(Sorry, being a new user I cannot use more than 1 link per entry for now)

haylem