Your Thoughts on the Groovy Scripting Language?
lelitsch asks: "Does anyone have first hand experience with Groovy?
I am just coming off implementing a Plone-based intranet CMS and got hooked on scripting languages and Python all over again. Since most of my projects in the near future are going to be in Java or have large Java components, I was wondering if it's time to trade Jython--which seems to be falling further behind the Python release cycle--for something else. Groovy sounds like a fun thing to look at, but it seems a bit new and thin. Also, what are other languages (JRuby and Rhino, for example) you have used to script in Java?"
Who cares if Jython is a little behind CPython if it already has all the features you need at this point? When I do work with CPython, I work from a relatively old edition of O'Reilly's Python in a Nutshell as reference, and find that the language at version 2.0 already does everything I need it to. While features added at 2.2 and 2.4 are undoubtedly useful for certain audiences, the language itself was complete for most purposes some time ago, and Jython should serve most people fine.
From what I've seen, Groovy's a half-baked programming language and unfinished product. See this criticism for a start.
If you want to do embedded scripting in Java, I suggest Bean Shell instead. As a library, Bean Shell is about 280K, Groovy is about 1.7M. And Bean Shell has been around for a lot longer.
I'd like to see Sun add closures and better support for lists/maps in Java itself (e.g. a map function). I'm hoping that pressure from Ruby will make the language grow. C# already made them change their mind about Generics.
I think you always need a reason before you try something new and unproven. If it is an enterprise app, why? Is there a feature that Python et al. does not do? If you have no experience with it, and no good reason to switch - Why bother?
"Sure there's porn and piracy on the Web but there's probably a downside too."
I wanted to use Drools and Groovy a while back to set up the variable pricing for a tollway. But who on earth is going to put that kind of system in the hands of technology named Drools and Groovy? No one wants to sound like an idiot going to their boss to suggest using anything with those names. Digital started off as Digital Intergalatic Research but quickly realized that suits don't use products that they feel stupid saying. A pun here or there is ok but there is a limit and I think Groovy, no matter what the technical benefits, has stepped over that line and can never be taken seriously. At least the Java community for the most part has gotten over the coffee metaphors when naming new products.
for lightness and performance. At least as far as scripting languages go. I can't say I'm a fan of Java but if you insist:
There is Java/Lua integration in the form of JLua and LuaJava. Possibly other tools as well.
The ratio of people to cake is too big
There is JScheme, and Kawa.
Weapons of Mass Analysis
I can't think of any reason people would choose C or Java over Ruby.
Even other scripting languages like Perl, Lua, or Python would clearly be foolish choices as well.
Seriously, Ruby's a great, well thought-out language, but if you listened to the hype you'd think that there couldn't possibly be anything better for any task at all. The fanboyism that's grown up around the language is starting to become really irritating.
Hecl: http://www.hecl.org/
it is perhaps less general-purpose than the poster might want, but I have different design considerations in mind:
Small, flexible, very dynamic, and concise - in other words, I want it to be a complement to Java, rather than simply a scriptable Java, ala Beanshell. This means that perhaps you wouldn't want to write the entire app in Hecl, but on the other hand, as a language to write quick extensions with, perhaps it's a bit faster/easier to work with.
The most interesting feature at this point is that Hecl is small enough to run on Java-enabled cell phones, even pretty basic ones like my Nokia 3100, which only accepts Java stuff - no symbian. This means that you can code apps with no recompiling, and also make them very dynamic (you could make an app that downloads code, stores it and runs it as needs be).
Also, for the folks who like this stuff, Hecl is still young, so there's lots of room to fiddle with the language itself, and learn about how a scripting language is built.
Astute observers will note that Hecl is similar to Jacl, but like the poster complaining about Jython getting a little bit out of date... it always seemed like a bit of a losing proposition to me to do a copy of a language in Java, because you miss out, if nothing else, on a *lot* of libraries, and the JRuby/Python/Tcl implementations have always seemed to be playing catch-up.
http://www.welton.it/davidw/
I have looked at Groovy but it does not seem stable enough to use in enterprise apps. However GNUStep for server side development is very solid platform. Objective-C, the language of GNU Step, is very good at talking with Ruby and Python.
My money is that there will be alot of attention passed to GNUStep in the near future as a condender on server side and even client x-platform side app development.
My Ideal web/app server is Free BSD + GNUStep + Ruby and/or Python.
JsD
Come on, there was a beta version of Generics floating around (that worked in 1.4) before C# was even out. The guys adding Generics wanted to add it much sooner (even in 1.3 I think) but there was too much contention in the community about how best to add it.
Java was a little slower actually getting it in, but that's because they had a lot of legacy code to consider and how to make generics that would be useful even with older libraries. In no way was Java actually pressured to include Generics just becasue C# had it, they faced a lot more pressure from a world of developers wanting something like generics from 1.0 on.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
There is a really nice Scheme interpreter on the JVM called SISC:
http://sisc.sourceforge.net/
IMNSHO Scheme is so much nicer than Python et al that there's not even a decision to be made here as far as dynamic languages on the JVM.
There's also Scala, which is another statically typed language on the JVM. It is SORT of like Java, and can use Java classes natively, but is about 20 times more pleasant to use than Java (if you're into higher-order functions and pattern matching and that kind of thing... but then, everyone should be into that stuff). Anyway, Scala isn't a scripting language, but depending on what you're planning on doing, using it may persuade you that you didn't actually need a scripting language, you just needed a language that wasn't painful to use like Java is.
Scala:
http://scala.epfl.ch/
At least it uses brackets instead of depending on indentation .
Copyright infringement is "piracy" in the same way DRM is "consumer rape"
I've used the rhino implementation of javascript as the basis for a scripting engine in a number of projects now. Javascript is lightweight, supports many useful idioms, and with rhino, integrates well with existing apps. Exposing your APIs to a scripting layer is pretty simple.
What particularly attracted me to rhino (apart from being a bit of a js nut) was the security model. That is to say, it has one, and it's pretty well worked out. It's typically nontrivial to add sandboxed scripting support to an application that integrates with the application's model of user permissions*: if you look around, you'll find lots of examples of various scripting languages being plumbed into applications, but typically the scripting layer is available to "admins only" due to these kinds of security concerns.
* even in java, which already has a semi-decent security model**
** It's a lot of work getting security providers to stack properly. Layering application-domain runtime security over an application running inside a container with its own security provider is barely doable.
A language doesn't have to be updated every 20 seconds to be good. If you started off working in JPython, I don't understand why you would switch it out for a less supported, and less developed language. Python has been kicking around for a while, enough time that they got most of the major kinks out long ago, so I don't think "falling behind in the development cycle" is as crucial as you might think it is. Why not stay with what works unless you specifically REQUIRE the new version's functionality? People are too quick to be trendy with languages...
Judges and senates have been bought for gold; Esteem and love were never to be sold.
Mind you, I'm do a lot of Ruby coding, and I love the language. However:
Again, I love Ruby. I'd rather code in Ruby than Java or C. I'm more productive in Ruby; it is a better language than C or Java. However, I'm really nervous about using it for any large (code-base) project.
--- SER