• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

Groovy chit chat

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There has been a lot of Groovy talk around the weblog arena, but I haven't seen much in here since that other thread I had started a while back.
Is anyone using it for anything other than "testing it" or "learning it"? What are your thoughts about Groovy?
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe the vast majority of corporate software developers out there are not using scripting languages for anything else than "startup scripts", which might be a good explanation for the quietness in this arena as well.
I, for example, would definitely consider Groovy as a main candidate along with Jython if I needed a scripting language that integrates seamlessly with Java. The problem is that I haven't encountered a good enough reason for using a scripting language (I'd have to learn it as well as sell it to the customer who certainly doesn't like the fact that very few developers know Groovy...).
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The main problem I have with Groovy is probably the fact that it is new. And the syntax is similar but not similar enough to other scripting languages like Python/Jython, Ruby, etc so that for me, it's not that easy to transition from one to the other.
If I had to choose one right this second and needed java integration, I would probably use Jython.
The problem is that I haven't encountered a good enough reason for using a scripting language
Ditto. I have thought of 1 reason to use a scripting langauge with any of my Java apps but it would require for the apps end user to learn the language as well. So to make it user friendly, I would have to write a very simplistic version of the language to sit on top, bla bla, too much work.
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All valid reasons.
Personally when I heard of Groovy my first and only thought was something like "oh well, another scripting language from some hobbyist with nothing else to do".
I'm working on learning Python/Jython, and Ruby may be next.
I've no need at the moment for scripting languages but it may come in handy for a bigger project I'm thinking about (writing my own IRC server, Jython has these very nice text processing capabilities and using a scripting language for configuration also has a nice ring to it).
In the workplace I'm just getting the next person slowly up to speed on JSTL, and seeing how much effort that is I don't want to try introducing a completely new language I don't even know well myself...
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeroen Wenting:
I've no need at the moment for scripting languages but it may come in handy for a bigger project I'm thinking about (writing my own IRC server, Jython has these very nice text processing capabilities and using a scripting language for configuration also has a nice ring to it).


I briefly considered providing an interface for writing billing integration modules with a scripting language at work, but it would've taken more time to a) develop the infrastructure, and b) (for module authors) to learn the chosen scripting language that it's simply easier to use Java.
I also thought about the configuration idea when someone blogged about his experiments, but I realized that using a scripting language would make the configuration file exposed to some serious complexity -- I want a configuration file to be dead simple to understand. I simply can't see a valid use case for needing a scripting language for (runtime) configuration.
 
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From my personal experience, scripting language is very much being actively used and developed in financial industry. I have seen applications using VBA to calculate profit & loss on a realtime basis. Tcl is also very common in this industry too.
I can think off ton of reasons to use scripting languages, but none of them would work well with Java. Why? I think the common use of Java is on the server side, and the need for users (business/technical) to write directly to server application is minimal. Especially with the XML technology etc, you can reload server setting without any problem.
I think scripting probably has more use on client application sides. For example: you want to have an application that does technical analysis of a stock, you can't possibly contains all the technical analysis in your package. You need the users to create his/her own and even share amongst them. Since your users are most likely non-programmers, the idea of compiler, interpreter, modules, etc. is out of their grasp, this is where scripting language comes in. Users can easily learn the basics, since they'll be only using a few of them.
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jeroen wrote: using a scripting language for configuration also has a nice ring to it
Be very, very careful with this. There's a huge anti-pattern lurking in there if you are unwary.
I once worked on a large, slow, and ungainly system. Nobody seemed to know what all the bits were for, so dared not touch anything. Along came the year 2000 and the powers-that-be asked our team to certify that there were no date calculations inside this hairball which might fail as the millenium clicked over. In practice, of course, this system was so flakey anyway that a few date bugs would hardly have been noticed, but that's corporate policy for you
Anyway, I drew the short straw, and set to work combing this 100,000 line lump for dates and times. I found several low-level routines for that sort of stuff, but couldn't easily work out where they were used. Every path I took seemed to lead to a dead end. Finally, I found myself in the code for parsing configuration files. The system a single config file with a lisp-like syntax containing half a dozen name/value pairs. People used to do hierarchical data like that before XML. I began to wonder why there was so much code to process it...
I looked a bit further and it dawned on me. The system didn't just read this config file, it executed it!. Huddled next to the cortex of this application was a complete enhanced Scheme interpreter and a load of definitions just so it could "run" this config file, with the side-effect of setting a few global configurations. The original implementors obviously had grandiose dreams of what the system might need, and how large it might grow to justify such a choice.
I ripped out the scheme interpreter, and replaced it with about 100 lines of simple bracket-counting state machine. I could justify this to my bosses, because I could say with my hand on my heart that there were no date calculations in my code.
How much code did I remove? 60,000 lines of tangled C++ The "tumor" I cut out was bigger than the rest of the body!
The moral of this little tale is that you should think twice before interpreting configurations. Configurations are a classic example of data that should be completely language-independent. You may want to process them with simple ad-hoc tools, you may want to read them in other applications. You certainly don't want to be tied to a specific, probably obscure, and potentially obsolete language.
To me scripting should be about behaviour, not data.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some good comments here.

I'm using Groovy for my Webwork actions on my current web-application project. I like developing the actions in Groovy becuase I like being able to change the action, reload the webpage, and see the results. Then for production I can compile Groovy scripts into regular java classes. More info here: http://adigio.com/blogs/christian

I've also used groovy as "configurable code". There are certainly dangers involved in doing so, but used carefuly I've seen it save a lot of pain.

Christian
Adigio, Inc.
http://adigio.com
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was thinking more of scripting things like reports to be sent to printers, not core program configuration.
reply
    Bookmark Topic Watch Topic
  • New Topic