Which could become a strong alternative JVM language: Scala, Clojure, Fan, JavaFX Script, or other?

2k Views Asked by At

I am currently deciding on an alternative JVM language to port an existing Swing desktop application written in Java 6. Given that JavaFX specifically targets this kind of application, it would seem that my best option is JavaFX Script.

However, what about other kinds of applications and libraries? Would JavaFX Script be the best choice in general for a second JVM language?

Currently, it seems that Scala is the most talked about alternative to the Java language. This month (October 2009), it is at position 34 in the TIOBE index, while JavaFX Script is at position 44, and Clojure, Fan, and Groovy are at positions below 50.

So, what are your impressions? Which language would you invest your time in learning and using (and why), assuming you can freely choose the language for a given project to run in the JVM?

3

There are 3 best solutions below

4
On

Those all sound like good choices. You could add JRuby to the list...

0
On

My main question would be: why are you porting an existing application? The answer to this question may give you some idea of where you want to go.

Some quick perspectives on the main choices:

  • Scala is in my view, a better Java than Java. If you want a language that takes the best bits of Java buts adds a lot of new innovations and features, then it may well be for you.
  • Clojure is an amazingly well designed language, particularly if you believe in a future of highly complex, concurrent applications. It's also extremely productive - I can probably create more value/hour in Clojure than any other language. However, unless you already know Lisp it will seem very unfamiliar at first. If you are willing to live on the cutting edge to get these benefits, Clojure may well be for you.
  • JavaFX script - has some very nice features for GUI design, and clearly has support of Sun/Oracle. On the other hand, I don't see it having massive traction outside this domain. I'd suggest giving it a trail run to see if it meets you needs.
  • Java - should still be on your list! If the reason you are porting is because the code has become difficult to maintain, then maybe a focused phase of re-factoring while staying on Java can get you the benefits you want. It's possible to write perfectly good GUI applications in Java.
  • Groovy - really nice scripting language on the JVM. Particularly good if you want to embed scripting features within an existing Java/JVM application. Not sure I'd choose it for (re)writing a complete application however.
  • JRuby / Jython - haven't seen these much myself but heard good things. Probably most suitable if you have Ruby / Python skills in the team but also want the benefits of the JVM platform.
2
On

The best alternate language, and the best language overall, IMO, is that which best allows you to write the program in the best model for you.

So, if you are writing a GUI app, then Scala may be the incorrect choice, as you wouldn't be moving away from Swing.

If JavaFX best meets your needs, then use that language.

If you know LISP then Clojure would be a good choice, but, like Scala, not for this problem, it sounds like.

If you don't know lisp and you want/need a functional programming language, then Scala would be the best choice.

Basically, there is no one language that is best in all situations, it helps to know what you want to do, and the strengths/weaknesses of the various options.