Ep 385: don't forget groovy++

94 views
Skip to first unread message

parentjo

unread,
May 23, 2012, 1:11:42 PM5/23/12
to Java Posse
Hi,

During the brief discussion of groovy's upcoming static typing I feel
groovy++ deserves to be mentioned as well. It is an extension/
companion for the current groovy release. It retains all of the groovy
goodness and adds static typing with a simple annotation. The static
typing is both at compile time (*) and at runtime. The lack of runtime
enhancements (MOP) gives it a clear performance boost compared to
dynamic groovy.

I used this in small project and it gives you all the enhancements to
Collection API, closures, terse syntax etc of groovy while being typed
like java. Personally, that's all I need.

It is no clear to me what the "interactions" are between the groovy++
and groovy project since the latter does not seem to refer to the
existing groovy++ work much. Politics perhaps?

More info and benchmarks at http://code.google.com/p/groovypptest/wiki/Welcome

Regards,

Johan

(*) From G. Laforge's talk @devoxx2011 I remember that initially the
type checking will be compile time only. Maybe that changed in the
meanwhile.

Jon Kiparsky

unread,
May 31, 2012, 9:31:44 PM5/31/12
to java...@googlegroups.com
It may make me a bad person, or a shallow one, but I cannot conceive of learning a language called "groovy". The idea simply turns my stomach. Could they not have come up with a less awful name? Like, maybe "scrotum"?


--
You received this message because you are subscribed to the Google Groups "Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.


Robert Casto

unread,
May 31, 2012, 11:29:44 PM5/31/12
to java...@googlegroups.com
Well there is the F language. And of course F#. Don't forget P#. Then there are all the Visual ??? languages. Scala of course and a bunch of others. So I think it could have been much worse though it is hard to get your boss to let work work on something that sounds like fun.
--
Robert Casto
www.robertcasto.com
www.sellerstoolbox.com

Ricky Clarkson

unread,
May 31, 2012, 11:55:56 PM5/31/12
to java...@googlegroups.com
P#? But that's not even a musical note, it's just a curious
infection. What are these people thinking?

Cédric Beust ♔

unread,
Jun 1, 2012, 1:31:51 AM6/1/12
to java...@googlegroups.com
On Thu, May 31, 2012 at 8:55 PM, Ricky Clarkson <ricky.c...@gmail.com> wrote:
But that's not even a musical note, it's just a curious
infection.

You should see a doctor about that.

-- 
Cédric

Kevin Wright

unread,
Jun 1, 2012, 2:05:19 AM6/1/12
to java...@googlegroups.com

Can I just point out that *I'm* not even the slightest bit curious!

phil swenson

unread,
Jun 2, 2012, 5:25:13 PM6/2/12
to java...@googlegroups.com
I think groovy is a good name myself. Why does software have to be dry?

Anyway, Groovy 2.0 will kill Groovy++.

But I think annotations are the wrong way to add static to the lang.
Guessing they had to for backwards compatibility? Ugly.
As I've said before, I think if groovy had been created as a
statically typed language in the first place, it would be much more
popular than it is.

Rakesh

unread,
Jun 3, 2012, 5:37:54 AM6/3/12
to java...@googlegroups.com
I've been using Groovy for a few months and so I'm no expert.

Here's some thoughts so far:

1. Love the POGOs with their automatic getters/setters/constructors.
2. closure syntax for loops is very nice.
3. The map syntax is great, being able to reference a url parameter like this : para.id
4. There's another level - builders, mixins, that I've only fleetingly seen but decided not ready yet.
5. People love to create DSLs but I'm not convinced of their worth everywhere. You need to know the DSL which is only slightly easier than learning the underlying library it tries to simplify. HTTPClient, take note.
6. Had a strange bug yesterday, I was reading json with JSonSlurper, a value representing seconds since epoch was automatically being cast to Integer, which turns out is too narrow because I multipy it by 1000 to get milliseconds (to pass to Date's constructor) but was getting the wrong Date. It was losing precision without complaining.
7. The mock testing situation is not quite good enough. MockFor and StubFor are not good enough. Everyone says use Spock but that's another library to learn.

I do feel at times that I am on the cutting edge as I program. I don't feel that with Java as its so stable in day to day use.

One use case that I think will be a killer is to create a Groovy library over the Amazon Web Services Java SDK. Thats going to be fun!

Overall, I like the syntax sugar and the Java-compatibility over everything else by a mile. I am slightly concerned if it will perform at runtime but I guess I'll have to test that.

Rakesh

Overall, its nicer than Java on a day to day level.

Steven Huwig

unread,
Jun 4, 2012, 12:19:18 AM6/4/12
to java...@googlegroups.com, java...@googlegroups.com
On Jun 2, 2012, at 5:25 PM, phil swenson <phil.s...@gmail.com> wrote:
As I've said before, I think if groovy had been created as a
statically typed language in the first place, it would be much more
popular than it is.

It would certainly be more popular with its own creator: 


"I can honestly say if someone had shown me the Programming in Scala book by by Martin Odersky, Lex Spoon & Bill Venners back in 2003 I'd probably have never created Groovy."

Thanks,
Steve Huwig

Cédric Beust ♔

unread,
Jun 4, 2012, 12:21:56 AM6/4/12
to java...@googlegroups.com
On Sun, Jun 3, 2012 at 9:19 PM, Steven Huwig <st...@huwig.info> wrote:
"I can honestly say if someone had shown me the Programming in Scala book by by Martin Odersky, Lex Spoon & Bill Venners back in 2003 I'd probably have never created Groovy."

For what it's worth, James is now an active Kotlin committer.

-- 
Cédric

phil swenson

unread,
Jun 5, 2012, 5:41:16 PM6/5/12
to java...@googlegroups.com
Kotlin looks nice. Best java replacement contender I've seen so far.

I do think it could benefit from a bit more syntactic sugar (like
array/map literals, null should evaluate to false) though….

rick

unread,
Jun 4, 2012, 8:01:53 PM6/4/12
to Java Posse
I know that Alex Tkachman (the guy that started Groovy++) has
contributed to the Kotlin project, so I'm not sure Groovy++ if really
moving forward.

Reply all
Reply to author
Forward
0 new messages