cunningjames•

I don’t think that’s really, um, the best place to link for news about Groovy. From this weirdo’s FAQ:

One of the Groovy 1.x despots has been going through samples of Groovy code I've put on the web and making small changes to the Groovy code base so my code no longer works.

Errrr yeah, I’m sure they have. You haven’t been cheeking your medication again, have you?

(This would be a more official link.)

12
vorgOP•

Define "official". You mean what the bishop in the cathedral announces, then all the priests echo?

-5
cunningjames•

For this scenario, let “official” mean “originating from those responsible for the release in question.” This article is not announcing the release, as the title would indicate, but rather a very strange and silly rant (which, frankly, I originally took as a joke).

10
vorgOP•

These could be the last Codehaus releases of Groovy under the current project management if this Groovy mailing list thread is in fact the rumblings of an impending leadership coup.

-6
cunningjames•

Somebody jumps the gun on a very, very preliminary announcement and one asshole, feeling left out of the loop, gets a bit nasty about it. If that seems like “rumblings of an impending leadership coup” to you, then I hate to see how big your molehills are.

13
AxiomShell•

Wow, what was that rant about Codeplex vs. Codehaus?

Are there two different Groovy branches running in parallel? Anyone got more info on this?

2
vorgOP•

The Groovy at Codeplex distro includes the statically-typed Groovy++ as well as the dynamically-typed Groovy 1.x from Codehaus. The Codehaus download doesn't have Groovy++ included, not sure why, but I think it's something to do with keeping topdown control of their codebase.

2
AxiomShell•

I see. Thanks for the explanation.

I've used Groovy for some hobby projects, but stopped following the mailing lists since 1.5. I was completely unaware of the Codeplex distro and always assumed Codehaus was the only place to check Groovy status.

1
marlinspike•

Has anybody been using Groovy for real-world work, and if so, would you care to share what you've used it for, and your experience with Groovy?

I played around with an earlier version, mostly from the perspective of a Ruby-esque language that when paired with Grails makes for an almost complete port of RoR. However, there were too many little annoyances, perhaps attributable to how new it was.

I'd be particularly interested in your thoughts if you've used Scala and have any feedback regarding the relative merits of Scala vs. Groovy.

2
bloodredsun•

We use Groovy to write our QA tests. This is especially useful when doing something like driving a Selenium2 instance where dynamic typing is a real benefit since if you use PageObjects you can't predict what page you are necessarily going to (think input errors).

Grails is great for back-end systems that don't have to scale too much (our web front end does 8 billion http requests per month) and the syntax makes a lot of sense for a Java-centric company.

We are big fans of Scala, especially what Akka can offer over thread based concurrency. The next big piece of concurrency work that we do will be written in Scala, and this is likely to happen in Sept.

4
wellmaybe•

Same here, for testing SOA services written in Java. I would prefer to use Java, because developers tend to stay away from Groovy (and therefore the running integration tests as a way of verifying their work) for some of its quirkiness. I also found that Groovy promotes laziness and sloppy code in some folks.

I had experimented with Groovy++. I may have noticed some performance improvements, but debugging was a nightmare, and the test harness was broken at some point due to a GPP-specific bug that I do not recall. I ended up ditching Groovy++ but I may consider it again in the future when it matures.

2
papa_stalin•

Exactly how we use Groovy as well. Groovy is awesome for anything QA related. If you got performance issues you can try Groovy++.

1
cooljoe311•

From my experience, groovy and grails is far too slow atm for any real world usage. Also its nearly impossible to debug thanks to the insane stack traces that come from groovys implementation of closures. While we see these issues on the server, there are a few practical uses for it right now. One example is that we use it for scripting to automate builds and deploys, and it works very well for that.

2
icjonu•

I was lucky enough to be able to use both Groovy & Grails in a production env. at my previous employer (fortune 500). We used it for dashboarding, reporting, testing & general scripting (nothing super CPU intensive).

LinkedIn actually uses Grails. See this presentation they did a while back.

2
oteren•

I'd like to know what your experience is. Most 'people on the internet' who rant about how slow grails is, are rather analogous to 'most people on the internet' claiming java is god awful slow. Of course profiling with conventional profilers is kinda useless, since the majority of the runtime is spent inside invokeDynamic, but that is why there is separate profilers for profiling groovy (and grails) code.

The standard stack trace in grails is far from 'crazy' and most often point you straight at the offender, just like you'd expect in a java app.

As for slowness 2.0 is wildly improved and it was never really that slow in the 1.3.x branch either.

If your experience was from the 1.1 days I will gladly accept your views, but they are very outdated and incorrect as per now.

1
cooljoe311•

Here is a simple test. Do something like file.eachLine({ println(it) }) and then do the equivalent java expression (without closures) for while(file.hasNext()){System.out.println(file.next);}

Excuse the most likely wrong syntax (It's been a while since I wrote my last grails app), but you get the idea.

It will quickly become obvious how slow closures in groovy really are. And if you plan to use the language as it was intended on the server, you will most likely find performance issues as you just begin to get a decent amount of traffic.

And yes, the standard stack trace in groovy generally consists of about 30 method calls on the stack related to invoking dynamic methods or closures, and then 2-3 lines that actually matter. Couple this with the extra calls on the stack for the grails framework, and you have what I would call a "crazy" stacktrace that is not really readable to anyone.

Don't get me wrong, I love the premise of Groovy and Grails. In fact, I would love for them to work out the kinks so that I could use it for more than just scripting. I'm a huge fan of GORM and dynamic methods, but the OP asked for my experience in practice, and this is sadly the honest truth. I could definitely see this being used for many company's internal apps - where the traffic would be much more manageable, but I just don't feel that it is up to snuff when it comes for a real customer facing application that could be getting 5-10 million hits a day.

3
oteren•

I don't quite get what that test has to do with grails being slow. First of all, any groovy code that runs in a grails request is usually of insignificant execution time compared to the rest of the request (network, routing, param bindings, bean injection etc). The grails implementation itself is mostly written in java and does not suffer from the groovy slowdown.

Secondly, if you for some reason needed higher speed in that file printing, you could either compile the java code in a groovy file, or simply implement your logic in java and call that (groovy++ should give you almost native speed too).

The long stack trace you generally got is annoying, I agree on that, even though it is of no real inconvenience other than having to scroll up there. Stuff has become way more terse in 2.0. STS, netbeans and intellij points you right to the offending code by clicking the stacktrace in the console just like regular java code, you just had to (before 2.0) scroll up to the top of a 30 line trace.

There is certainly no lack of successful huge deployments with grails: http://grails.org/Testimonials .

Serving a billion requests a month is more of an infrastructure / architecture design issue than it is a language/framework issue.

I might come off as a fanboy (guilty as charged), but I do get a bit tired of people claiming bad things about grails that simply are not true.

2
check3streets•

I've used groovy extensively for embedded scripting and some ant-like tasks. This was all around 24 months ago, since then the language has presumably matured.

Upside: I like groovy's specification a lot, in the sense that Java can really use a dynamic language that integrates snugly and employs the many language features people crave today, closures, first classish collections, ducktyping. Ie. I believe the aim is correct.

Downsides (as of 24 months ago):

  1. core features were (maybe are?) fragile. I ran into some acknowledged bugs with pretty basic elements like gStrings.

  2. it can be damn slow, so I gave up on using it where performance was important.

  3. compiled vs uncompiled. I got a huge boost from compiling a naked groovy file as opposed to loading groovy code at runtime and instantiating an object containing the same code. And I mean the execution time post-instantiation.

  4. debugging is painful, the tools aren't there and the errors are opaque.

I like Scala but Groovy wants to be Python/Javascript/Ruby and Scala wants to be a java-friendly functional language. I'd make my decision more based on which paradigm I wanted.

2
vorgOP•

Upside: I like groovy's specification a lot,

Hu...hmm.

Groovy doesn't actually have a specification. One was started as a JCP over 7 years ago but hasn't moved since 29 March 2004. Oracle recently wanted to delete it due to inactivity, but the spec lead logged in and made some edits, presumably to create the illusion of activity.

There isn't any other spec for Groovy either, anywhere. This distinguishes Groovy from, say, Scala.

1
check3streets•

That's a little pedantic. A specification is a description of the syntax and semantics of a language. Groovy certainly has both language semantics and syntax.

But since we're at it.

A programming language specification can take several forms, including the following: A model implementation, sometimes written in the language being specified (e.g., the Prolog). The syntax and semantics of the language are explicit in the behavior of the model implementation.

1
[deleted]•

Little pedantic?

http://groovy.codehaus.org/jsr/spec/index.html

I would describe the situation as "having no spec", that's the most appropriate thing.

3
meddlepal•

I use Groovy daily at my job. It is used as both the default scripting language binding to our platform as well as the language of choice for writing quick and dirty tools to work with our platform. Groovy is a first-class citizen at my company, but it tends to be used for things where Java or C++ are not the best options. Right now I'm actually working on a new project with a Groovy core and using the GPars concurrency library to provide the language with some great high-level concurrency facilities similar to what is available in Scala.

I use Scala as well, mostly as my personal language of choice for my own projects, but also for the occasional work-related project. Absolutely love the language. I love statically-typed languages and Scala has a beautiful type system and the blend of FP and OO makes it very attractive to me as someone who sees benefits and drawbacks to both approaches. However, they are worlds-apart in their use-cases. Scala I could see being used for our platforms back end because of its static-typing (though I believe that is being addressed by Groovy++), strong concurrency (Scala Actors or Akka), and speed. I don't think there is a chance in hell Groovy would ever be considered if a rewrite were in the pipeline.

To me Groovy is a bit like the weird love-child of Java and Ruby (or Python.) I found it took zero-time to learn it and get comfortable coding in it coming from a background with experience in Java and Ruby. Syntax and concepts were immediately familiar.

2
unclebobsucks•

Used 1.5.4 for a production project. Found it slow and bug-ridden. Had a java class that subclassed a groovy class. Occasionally the jvm would try to call a private method on the subclass from the superclass. Rewrote the subclass in java. Problem solved.

Out of memory errors magically disappeared when groovy code was rewritten in java, and things ran much faster. Project now contains 0 lines of groovy code.

TL;DR groovy is an awful language that should never be used for anything.

1
meddlepal•

Recent versions are better. 1.8 is pretty darn solid. I wouldn't use it for anything mission critical though, but there is a difference in my mind between mission critical and production ready where the latter is a spot I think Groovy can be used relatively painlessly.

0
unclebobsucks•

Have they improved memory usage? The implementation of array.each made useless copies of the entire array to iterate over, and the xmlslurper made doms with lots of maps and lists containing no elements but having space for several preallocated.

My list of annoyances with groovy is long, and that's left me with no confidence in either the designers or the implementers of the language to get things right.

I'm not sure there really is a distinction between production and mission critical. Obviously not all production software is equal in importance, but the assumption is that if something breaks it needs to be fixed. Usually ASAP. Anything that causes software I need to support to break more frequently must be discarded, not just because that will save me time and annoyance, but also because production software should fail as infrequently as possible.

3
[deleted]•

It doesn't really make sense to use Groovy in my opinion.

Groovy is slow, has no spec, is bug-ridden and lacks any meaningful documentation where one would actually could need one.

Before Scala had Dynamic is used Groovy once to implement some custom DSL, which basically created method names based on some Excel sheet. It was goddamn awful.

Never again. Groovy is PHP for the JVM. No clear vision, lack of oversight.

0
vorgOP•

Featuring right now on the Codehaus Groovy mailing list...

Looks like there could be another coup for the Groovy leadership in the works, just as the current project manager Guillaume Laforge goes on holiday. What sort of thug takes away another's job when they're on holiday?

-4