Forum Controls
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

Java, the OLPC, and community responsibility

The "One Laptop Per Child" project has a great device ready to ship, but there's no Java on there. Let's think about working together to put Java on OLPC!
Replies: 161 - Pages: 11   [ 1 2 3 4 5 6 7 8 9 10 | Next ]
Threads: [ Previous | Next ]
  Click to reply to this thread Reply

Groovy or stuck in the groove?

At 5:49 PM on Dec 6, 2006, Alex Blewitt DeveloperZone Top 100 wrote:

Groovy is billed as "An agile dynamic language for the Java Platform with many features that are inspired by languages like Python, Ruby and Smalltalk, making them available to Java developers using a Java-like syntax." I seem to remember writing about Groovy is almost here in July 2004, and it's been almost here ever since.

The idea is a neat one; allow scripting that can interact with Java, as well as its libraries. At the time, I wrote "The same 'Not Invented Here' syndrome still exists, and at the end of the day, the language feels like it has been evolved rather than designed." In fact, rather uniquely for programming languages, the parser was initially hacked together rather than a syntax being described (with the resulting bugs that that permitted; in the end, the parser was thrown away and a grammar distilled and re-built).

However, whilst Groovy was novel at the time, there are other -- some would say better -- scripting languages that can interact with Java and run on JVMs. For example, there's BeanShell , which is a pretty good scripting tool for Java code, not to mention other runtimes that sit on top of a JVM ( Jython , the python implementation in Java, as well as JRuby , the Ruby implementation in Java -- recently with some employment from Sun ). Of course, the cool thing about all of these languages is that they have Eclipse plugins which can allow you to edit and run code inside Eclipse.

Not only that, but there's also some really cool languages coming out that are built upon Java, such as the Scala programming language, which allows integration with Java but in a combination of functional and object oriented techniques to be used. Then there's dynamic event-driven languages like Flapjax (although that's more for web-based applications).

So, is 1.0 finally groovy, or is it an idea whose time has come, gone, and been replaced by better alternatives? Will you be using Groovy?
  Click to reply to this thread Reply
1. At 8:19 PM on Dec 6, 2006, Dominique Boucher Javalobby Newcomers wrote:

Re: Groovy or stuck in the groove?

Being a Lisp guy, I mainly use SISC and Kawa, two Scheme systems that run on the JVM. The latter compiles directly to JVM bytecode, delivering performance close to Java code.

Also, Kawa is embedded in the SchemeScript plugin, a full-featured Scheme editor for Eclipse. It can even be used to script Eclipse.

Kawa - http://www.gnu.org/software/kawa/
SISC - http://sisc.sourceforge.net
Schemecript - http://schemeway.sourceforge.net
  Click to reply to this thread Reply
2. At 1:44 AM on Dec 7, 2006, Gerd Castan Javalobby Newcomers wrote:

Re: Groovy or stuck in the groove?

You are enumerating languages as if the only way to choose one is how long they've been around.

For me, Groovy is the next big thing. Not replacing Java but getting a big share. I will enjoy it even without explicit support in Eclipse. But I would love to have Groovy support in Eclipse.

Gerd
  Click to reply to this thread Reply
3. At 3:52 AM on Dec 7, 2006, Alex Blewitt DeveloperZone Top 100 wrote:

Re: Groovy or stuck in the groove?

Actually, I'm enumerating languages in inverse to how long they've been around. Groovy has been around *ages*, and frankly, hasn't managed to get far in that time. Other ones have made more traction, though (for example) the underlying languages of Python and Ruby predate their Java implementations.

Flapjax and Scala are relative newcomers as far as languages are concerned.

In any case, there's a 'work in progress' Eclipse plugin documented for Groovy:

http://groovy.codehaus.org/Eclipse+Plugin

Alex.
  Click to reply to this thread Reply
4. At 4:06 AM on Dec 7, 2006, Graeme Rocher Blooming Javalobby Member wrote:

Re: Groovy or stuck in the groove?

Please for the love of god stop comparing Groovy to BeanShell. BeanShell is great in that it allows you to omit the type and is hence dynamically-typed, but that is where the comparison ends.

BeanShell is what VBScript is to VB, it is a language with a near identical syntax that allows optional typing. Groovy on the other hand is in the same category as Ruby and Python in that it has support for meta-programming, DSLs, advanced syntatic constructs for maps, lists, ranges etc, closure support etc.

They're quite simply not in the same ballpark. In terms of Groovy vs. JRuby/Jython.. what you get is tight integration with Java, the JVM and its libraries which equals:

- compilation to byte code
- ability to extend, implement, invoke, do whatever with Java. In other words a Groovy Object == Java Object
(JRuby and Jython both have limitations here)
- The same class library with dynamic extensions (no need to learn new I/O, collections etc.)

And as far as Eclipse goes, if you want scripting there is an Eclipse plugin as mentioned in a previous comment, and there is also a project called Groovy Monkey (http://groovy.codehaus.org/Groovy+Monkey) that does a similar thing to Grease Monkey from FireFox in Eclipse.

Trust me, Groovy is going to be huge ;-)
  Click to reply to this thread Reply
5. At 4:07 AM on Dec 7, 2006, Jilles van Gurp DeveloperZone Top 100 wrote:

Re: Groovy or stuck in the groove?

There's several scripting languages for the jvm but few with production quality quality interpreters. And that's what is holding them back right now.

JRuby is not close to a 1.0 release and while promising still has problems related to performance and integration into the jvm as well as problems with supporting standard ruby stuff (e.g. the more advanced rails stuff). These problems are being worked on of course but it's not quite ready yet.

Jython was once a promising python for Java. Then development virtually stopped a few years ago only to pick up somewhat recently. For all practical purposes it is abandonware right now. Also python is rarely used for web development nowadays. It seems php, ruby and other languages have marginalized its use there.

Groovy has been under construction for years now and has been undergoing major compatibility breaking changes on a regular basis. For that reason I've not spent any time with it so far. Now that it is actually close to a 1.0 I might actually check it out for a bit. Also important for me is that language + interpreter were designed from the ground up to be used in a Java environment. A new language is one thing but a new set of libraries is another. I sort of like the maturity and extremely wide scope of the Java APIs (standard and add on). The good thing about groovy is that it doesn't even try to replace those.

However, despite this, it seems that JRuby also has quite a bit of momentum behind it and it wouldn't surprise me if it caught up quickly.

Bottom line, I need some level of stability and quality to even consider spending time on any of these. Groovy seems more or less first to market with a feature complete, up todate 1.0. There's of course other, more obscure scripting languages but I'm not really interested in using those for the above reasons or because of the fact that the languages are not that interesting (e.g. beanshell).
  Click to reply to this thread Reply
6. At 5:31 AM on Dec 7, 2006, Zhong Javalobby Newcomers wrote:

Groovy Eclipse Monkey Rocks

Have you ever tried Groovy Monkey? This plug-in allows you to run groovy code to control the eclipse workbench, projects, views, everything.

http://groovy.codehaus.org/Groovy+Monkey

Here are two scripts I wrote recently. One let you restart eclipse with single click. The other helps to add/remove natures for selected projects. You don't even need to write any plug-in xml. Just create a gm file and run...
  Click to reply to this thread Reply
7. At 5:59 AM on Dec 7, 2006, Alex Blewitt DeveloperZone Top 100 wrote:

Re: Groovy or stuck in the groove?

> Please for the love of god stop comparing Groovy to BeanShell.
> BeanShell is great in that it allows you to omit the type and is
> hence dynamically-typed, but that is where the comparison ends.

Sorry, you're right -- they're different. People have been using BeanShell to do useful things for years :-)

You can have dynamic functions in BeanShell, using somewhat more verbose Java-like syntax for doing reflection:

http://www.beanshell.org/manual/reflectivestyle.html#Reflective_Style_Access_to_Scripted_Methods

The point I was making is that Groovy isn't the only useful language that can interact with Java. If scripting existing Java is all you need, BeanShell is just as good.

> Trust me, Groovy is going to be huge ;-)

How different is that from, say, people saying exactly the same thing back in 2004, four or five compatibility breaking changes ago? They said it was going to be huge then, and it's about as huge now as it was before.

Perhaps you can redfine 'huge' to be something else in Groovy, like 10e-6 ...

Alex.
  Click to reply to this thread Reply
8. At 7:30 AM on Dec 7, 2006, Gerd Castan Javalobby Newcomers wrote:

Re: Groovy or stuck in the groove?

Your posting reads like a mind virus:

1) Groovy is bad since I haven't done anything with it in the last years.
2) Don't do anything with Groovy, since Groovy is bad.
  Click to reply to this thread Reply
9. At 7:50 AM on Dec 7, 2006, Alex Blewitt DeveloperZone Top 100 wrote:

Re: Groovy or stuck in the groove?

Actually, it was more of a question: are you/will you be using Groovy? Or are the alternatives worth considering?

I don't actually say the language is bad in the post. In fact, it's got quite a few neat features, and the idea of scripting intermixed with Java is a good one; but Groovy isn't the only one that has that idea.

Nor do I say that people shouldn't do anything with Groovy, either. It's one of the hallmarks of good programmers to be aware of what else there is, and different styles of programming (functional, procedural, declarative, object oriented, etc.). I think people should look at Groovy.

But the point is that languages, like compilers, need to be stable enough for people to use them without the fluctuation. Even Subversion, during its long development before the 1.0 release, was very stable indeed, and stuff that was checked in could be acquired later. I'm not sure that you could say that for programs that were written in the early days of Groovy.

So, it's not a slant against groovy; in fact, great, they've finally made it to almost 1.0 after two years, when it was 1.0 beta 6:

http://docs.codehaus.org/display/GROOVY/2004/07/15/Groovy+1.0-beta-6+released

By way of internet timing, that was also when Eclipse 3.0 was released (and now we're half way through Eclipse 3.3), and Java 5 was released two months after this '1.0b6'.

So, the underlying question is, will I write back in 2008 about the time when 'RC1 was just around the corner' referencing this article awaiting Groovy 1.0-No,Really?

Alex.
  Click to reply to this thread Reply
10. At 9:48 AM on Dec 7, 2006, Shinji IKARI Blooming Javalobby Member wrote:

Re: Groovy or stuck in the groove?

> In fact, rather uniquely for programming languages,
> the parser was initially hacked together rather than
> a syntax being described

I think Perl innovated this technique, except I don't know that the syntax has ever been fully described.

> However, whilst Groovy was novel at the time, there
> are other -- some would say better -- scripting
> languages that can interact with Java and run on
> JVMs ... > href="http://www.beanshell.org">BeanShell , ... > href="http://www.jython.org">Jython ... > href="http://jruby.codehaus.org/">JRuby

BeanShell and Jython are much more functional and mature than Groovy and JRuby. Groovy was never novel. You also missed Rhino .

> So, is 1.0 finally groovy, or is it an idea whose
> time has come, gone, and been replaced by better
> alternatives? Will you be using Groovy?

I think that JavaScript is a much better investment than Groovy for a Java-like scripting language for the JVM.

I can't see the rationale for hyping a new JVM-only dynamic language with heavy syntactic sugar. We already have two heavily-sugared languages on the JVM (Jython and JRuby) that have established themselves.

Why limit a new dynamic language to the JVM? Indeed, why write a new dynamic language for production uses at all? Is there something wrong with the ones we have?

Of course people should feel free to design languages for educational purposes, but that's not the noise coming from Groovy.

http://www.itworld.com/Comp/3380/lw-12-ritchie/
Dennis Ritchie: At least for the people who send me mail about a new language that they're designing, the general advice is: do it to learn about how to write a compiler. Don't have any expectations that anyone will use it, unless you hook up with some sort of organization in a position to push it hard. It's a lottery, and some can buy a lot of the tickets. There are plenty of beautiful languages (more beautiful than C) that didn't catch on. But someone does win the lottery, and doing a language at least teaches you something.

Oh, by the way, if your new language does begin to grow in usage, it can become really hard to fix early mistakes.

  Click to reply to this thread Reply
11. At 9:37 PM on Dec 8, 2006, Paul King Occasional Javalobby Visitor wrote:

Re: Groovy or stuck in the groove?

I look forward to the day when every Ubuntu release just has a JVM and Groovy, and perhaps even Eclipse ;-), just built in. All your platform scripts could be done in Groovy.

Why limit yourself to 70's shell technology when you can have all of Java, all of Ant and all of Groovy's magic (special support for Lists, Maps, XML, Databases, Closures, Lazy evaluation) right at your fingertips!!

It's also an incredible Agile programming language. Not only does it let you leverage all of Java's recent advances, it often makes many issues just go away. You don't need the latest mocking package because capturing expected behaviour is exactly what closures do. You don't need to work out the best BDD/literate programming technique to use because the language lends itself to DSLs and the code and tests you write are much more expressive. You don't need to worry about where you object leaks are because you didn't close a connection - the language does that for you. You don't need to evalute which of the many XML APIs you need to learn and use to make XML processing more productive - that's built-in to the language also. You don't need to wait until Microsoft releases LINQ to have lazy-evaluated database support at the language level - that's built right in too.

Is it perfect? No. Has it had a few roadblocks? Yes. Did the process of becoming an official JVM language slow down a 1.0 release? Yes. Has it had poor documentation in the past? Yes. Has it had less than ideal backward compatibility in the past due to finding its feet and insufficient test coverage? Yes. But after getting through those hurdles, is there now a fun, energised and organised community behind it? You bet!!
  Click to reply to this thread Reply
12. At 9:44 PM on Dec 8, 2006, Paul King Occasional Javalobby Visitor wrote:

Re: Groovy or stuck in the groove?

> BeanShell and Jython are much more functional and
> mature than Groovy

That isn't my experience, in fact my experience is just the reverse.

> I can't see the rationale for hyping a new JVM-only
> dynamic language with heavy syntactic sugar. We
> already have two heavily-sugared languages on the JVM
> (Jython and JRuby) that have established themselves.

I can only refer to my experiences, but they both have much less take up than Groovy in the projects I have visibility to.
  Click to reply to this thread Reply
13. At 9:18 AM on Dec 9, 2006, Shinji IKARI Blooming Javalobby Member wrote:

Re: Groovy or stuck in the groove?

> Why limit yourself to 70's shell technology

What do you mean by that, exactly?
  Click to reply to this thread Reply
14. At 9:20 AM on Dec 9, 2006, Shinji IKARI Blooming Javalobby Member wrote:

Re: Groovy or stuck in the groove?

> I can only refer to my experiences, but they both
> have much less take up than Groovy in the projects I
> have visibility to.

I meant that Python and Ruby have established themselves, though I have seen plenty of Jython and no Groovy in the projects that I "have visibility to."

thread.rss_message