I've had Ruby sitting in my ToDo list for far too long. I mean, at least for a couple of years! It's been so long that in the time some fellows have made into the list as well, namely Groovy and Scala.
Finally, this year, I've decided that the time has come and that I have to invest some effort. Unfortunately, I know have to decide where.
I will start saying that all three candidates share the basic functionality that I'm looking for:
I could choose JRuby then, but I'm not sure that's the correct path even though Sun's commitment (for example, with Netbeans and the compiler) seems pretty heavy.
Scala could be. Indeed it's improving (as the others) but it's not there yet. In the end, Scala seems more like a (future) Java replacement and that's not what I'm looking for right now.
Finally, this year, I've decided that the time has come and that I have to invest some effort. Unfortunately, I know have to decide where.
I will start saying that all three candidates share the basic functionality that I'm looking for:
- Scripting
I want an interpreted language that saves me time to come up with quick prototypes and hacks. I want a powerful OS tool beyond shell scripts. I may need to compile to bytecode later as well. - Elegance and expressiveness
I want to avoid boilerplate. I need dynamic typing and runtime inference. I want syntax sugar! I want easy to read DSLs. - Closures
They are a must. My only concern is readability but beyond that I cannot understand why Java does not have them yet. - Mixins
Inheritance on steroids. - Go Functional
Try to combine imperative style with some characteristics natural to functional programming. Less what and more how (descriptive style).
- Ruby
The first of the crop and the most popular for sure.- Pros
- Refreshing (depart from C syntax)
- Rails
- Mature (since 1995)
- Community
- JRuby / SUN involvement (leverage the Java platform)
- Cons
- Too much hype
- Lacks "enterprise" consideration (Threading? Scaling?)
- Low ROI (see market penetration)
- Is it loosing momentum?
- Pros
- Groovy
Enterprise capabilities along with cool productivity features- Pros
- Tight Java / JVM integration
- Extends JDK API(GDK)
- Easyness / Learning curve
- Out-of-the-box Spring integration
- Grails
- Cons
- Performance
- Pros
- Scala
A general purpose (multi-paradigm) programming language- Pros
- Interoperability with Java
- Language features not retrofitted (ie Genericity)
- Actors, concurrency and distributed programming
- Implicit enrichment of a Java class
- Statically typed with inference
- Cons
- Tooling
- Not mainstream yet
- Smaller community
- Pros
I could choose JRuby then, but I'm not sure that's the correct path even though Sun's commitment (for example, with Netbeans and the compiler) seems pretty heavy.
Scala could be. Indeed it's improving (as the others) but it's not there yet. In the end, Scala seems more like a (future) Java replacement and that's not what I'm looking for right now.

7 comentarios:
Groovy is a good choice but Ruby may be better for your first requirement: general-purpose scripting/quick hacks. Why not learn them both?
Scala isn't a dynamic language. :-)
@Mark I really wish I had the time
@Daniel David Pollak suggests it is. I'm eagerly waiting for the article about runtime modifications
I think Scala is not actually a dynamic language. Optionally you can do duck typing, but I don't think that's enough to classify it as a dynamic language.
The authors classify themselves as statically typed language: http://www.scala-lang.org/docu/files/ScalaOverview.pdf
I think Scala is a diferent breed.
Good post anyway!
David Pollack was being metaphorical. Due to various features, Scala can achieve some of the concision of "dynamic languages."
The phrase "dynamic language" usually at least means a dynamically typed language. Scala is statically typed language.
Also, Scala does not have "duck types," it has structural types - which may appear similar but are definitely not the same.
The other thing the phrase is usually applied to is dynamic metaprogramming. Along those lines, Scala's metaprogramming facilities are just those of Java.
If I invest time in learning a framework, first of all it should benefit me now or in future, it should be enterprise ready and scalable with good tooling support. I agree with you that only groovy matches these criteria at least for now.
One important consideration is how strings are handled and how well the language can deal with Unicode. This means reading, writing, regular expression matching, substringing, determining length etc. correctly with strings that contain unicode characters.
Another important consideration for real work is the number of available libraries/modules. For languages running on the VM this means on the one hand: how easy is it to wrap Java library classes and how many have been wrapped AND how many other libraries modules are there (e.g. with JRuby, how many PURE Ruby libraries are there and do work in JRuby).
Anyone who has already written program in perls and used dozens or hundreds of the available modules there knows how much time you can save by using instead of programming something.
Publicar un comentario en la entrada