Sunday, June 04, 2006

Why is Groovy is big?

Sorry to beat a dead horse, but I remember several months ago somebody in #concatenative (eiz, perhaps) mentioning that Groovy has reached 120,000 lines of Java code... they asked how can a scripting language get so big, especially as it doesn't provide its own runtime services and runs on the JVM? Well if you look at the Groovy CVS today, you'll see it has in fact managed to grow to 300,000 lines.

In comparison, Factor consists of 8400 lines of C and 29,000 lines of Factor. This includes a lot of code that a JVM-based language does not have to implement, such as platform-specific GUI bindings, native code generation, and the UI.

I tend to think the majority of code people write is overly complicated, full of redundancy, and designed for such flexibility that in practice is not needed at all. I hope one day this trend reverses.


Dierk Koenig said...

I agree most code one sees these days is too fat and in the Groovy project we could also do much better.
However, reducing the size of the codebase is currently not our main focus. Later, when we can rewrite large portions of Groovy in Groovy, you'll see a much smaller codebase.
I'd also like to mention that Groovy does provide a runtime even though it sits on the JVM. Also, your current measures include all the extension modules that are not part of language itself (IDE integrations, GoogleDate Support, Groovy SOAP and else).
Calling other's work a 'dead horse' and complaining about too much growth in the work done doesn't fit well together IMHO.

Graeme Rocher said...

Agree with Dierk here, although I don't think Slava was calling Groovy a deadhorse (?).

The conclusions made are a bit silly, for one Groovy and Factor are written in 2 different languages. If you're going to do a comparison it would be more accurate against something like Python (ie something written in C).

As Dierk mentioned although it sits on top of the JVM Groovy DOES provide an additional runtime through its meta facilities and the GDK.

Clearly though as with any large project like Groovy the CVS repository is due for a spring clean and programmers do tend to make their lives harder. I think however that the answer to your question lies in the title itself.

Groovy is so big because it is big (and not in terms of lines of code), it has a flourishing community, a large user base, industry support (Oracle, Sun etc.), countless modules and add-ons (including Grails).

Really there is no comparison as Factor is a little known language with limited industry visibility, although clearly I wish you every luck with it as I have enjoyed your work in the past (as a jEdit user).

PS Why do you have to "post" a comment to "view" the comments, are you scared of what people might say? ;-)

Guillaume Laforge said...

If you look closely at the lines of code of groovy-core, the core module of the Groovy language, there are about 70000+ lines of Java code, and 30000+ lines of test code either in Groovy or in Java.
In those 70000 lines of code, there are the Meta-Object Protocol, all the wrapper API around JDBC, Swing, the Groovy Development Kit, and so on.
So, considering the wealth of the language in terms of functionality and coverage, I don't think it's that big, even compared to Factor.
I find that a bit silly to make such comparisons: comparing apples and oranges has never been a good measure of anything.