I've been a zone leader with DZone since 2008, and I'm crazy about community. Every day I get to work with the best that JavaScript, HTML5, Android and iOS has to offer, creating apps that truly make at difference, as principal front-end architect at Avego. James is a DZone Zone Leader and has posted 639 posts at DZone. You can read more from them at their website. View Full User Profile

What Is the Most Popular Scripting Language on the JVM?

  • submit to reddit

I'm an old-fashioned Java developer - I still haven't got around to using any of the scripting languages on the VM. It's definitely time that I got around to it, and right now Scala seems like the most appealing choice. According to Martin Odersky, of Scala/Typesafe fame: 

Java 7 will mean better runtime performance for Scala developers. In the future, invokedynamic, a new Java bytecode, will also gain importance for  developers. 

So it seems that we're definitely in the age of dynamic languages on the VM - so which language is the most popular within the JavaLobby community? Please choose the one that you use from the choices below. If you're like me, and haven't used any yet, just indicate which one you'd be most likely to use.


Nicola Ambrosetti replied on Fri, 2011/08/19 - 2:07am

I thought Scala was statically typed... Is it also used for scripting?

Niels Peter Str... replied on Fri, 2011/08/19 - 4:08am

I have done some projects in Groovy and I really like the language, but I miss static typing. I have just started to learn Scala. I must say that I find the language to be complicated and that might be Scalas Achilles’ heel. I cannot see Scala replace Java as the first language you learn in school. So Groovy is properbly the easiest language to learn, but it is much slower than Scala.

Ronald Brindl replied on Fri, 2011/08/19 - 4:56am in response to: Nicola Ambrosetti

Scala IS statically typed, and it IS used for scripting, too, allthough i would not consider Scala a Scripting language. This of course raises the questions: "What is a scripting language?" and "What is the other kind of language called, then?".

IMHO Scala and Java are on the same level, but I don't know the others (like Ruby, Groovy, etc) good enough to say anything about them.

Ronald Miura replied on Fri, 2011/08/19 - 5:30am

Where is JavaScript (Rhino)? It's a language almost every programmer has to know at some extent, and it ships with the JRE since v6, so it's the currently most accessible 'JVM' scripting language.

Jacek Furmankiewicz replied on Fri, 2011/08/19 - 5:47am

Where is Jython? We integrated it into our stack so that our PS team can write customer-specific extensions in it. And why is Kotlin there? that language barely exists, except on a Wiki page.

Greg Brown replied on Fri, 2011/08/19 - 7:50am in response to: Nicola Ambrosetti

Scala is a compiled language, but I believe there is also a script engine for it.

Greg Brown replied on Fri, 2011/08/19 - 7:52am in response to: Ronald Miura

Yeah, JS should be an option in the poll. It is easily the scripting language I use most on the JVM.

Manuel Jordan replied on Fri, 2011/08/19 - 9:01am

James, I think the follow article should be a table of comparison about many features among them, to take it for reference if some developer want learn a JVM language but he doesnt know what language should be the first

Jacek Furmankiewicz replied on Fri, 2011/08/19 - 9:02am

And BTW, don't think that the JVM is so far ahead. The work the PyPy team is doing for building a JIT runtime for Python is pretty phenomenal. The new version 1.6 is smoking fast: on a simple web app test I did using PyPy and Twisted I was getting 6500 TPS (!). The equivalent Jetty/Spring/JAX-RS app was giving me 4500 TPS. So the implicit assumption that the JVM is the fastest runtime for scripting languages may not be correct anymore. Just something to keep in mind.

Raw ThinkTank replied on Fri, 2011/08/19 - 10:16am in response to: Jacek Furmankiewicz

Since jvm claims to be as fast as native mode, seems like your tests are faster than native mode, or may be someone did BIG lie in the past.

Robert Hicks replied on Fri, 2011/08/19 - 10:24am

Clojure and Scala are not "scripting languages" period. I would put both of those on par with Java.

Where are Jython and Rhino?

Jacek Furmankiewicz replied on Fri, 2011/08/19 - 12:17pm in response to: Raw ThinkTank

It could be a diff also between Jetty NIO and Twisted async I/O. Either way, it's not the "Python is 100 slower than Java" statements I've seen in blogs in the past. PyPy is closing the gap...and fast. Even I after I added some complex intensive operations (like a regex search on a complex JSON document or a full parse of a JSON doc into an object model), PyPy was still giving me 1500 TPS.

Chris Alexander replied on Fri, 2011/08/19 - 12:31pm

Like @Neils Peter said, "Where's JS"? The beauty of specifying a ScriptEngine (since 1.6) is that you can use precanned engines (JS being the most popular) or bolt one on yourself. I just don't see the advantage of learning another scripting syntax when JS is the most prevalent and knowledgable scripting language in the world. I would love to see some metrics on executing JS vs. those listed above. That's the take-away most readers of this article are probably looking for.

Cay Horstmann replied on Fri, 2011/08/19 - 1:03pm

Scala may not be a scripting language, but it is a great language for writing scripts. You can do a lot with small snippets of code, and you have the REPL to experiment, just like a traditional scripting language such as Python. The best part is that you don't have to learn two languages, one for scripting and one for heavy lifting.

Andreas Fink replied on Sat, 2011/08/20 - 5:41am

I voted for "other". Have been using Javascript on the JVM beginning with FESI, later on with Rhino via BSF. Jacl (Tcl) via BSF was also great fun!

Richard Vowles replied on Sun, 2011/08/21 - 2:13am in response to: Niels Peter Strandberg

If you are finding Groovy slow at runtime or needing static typing, add Groovy++ to your classpath and mark your classes @Typed. You get Java performance, and static typing with all the other benefits of Groovy except MOP (which you can do in @Mixed methods). Going back to plain Groovy is as simple as removing the @Typed. Groovy++ is a superb addition to Groovy!

Rob Newton replied on Mon, 2011/08/22 - 2:41am

I voted Other for:   Jython

Darren Salomons replied on Wed, 2011/08/24 - 12:24pm in response to: Jacek Furmankiewicz

Do you have your benchmarking and source documented anywhere?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.