aspose file tools*
The moose likes Groovy and the fly likes Non-Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Non-Java "Scripting Language" Most Like Java and Still Known" Watch "Non-Java "Scripting Language" Most Like Java and Still Known" New topic
Author

Non-Java "Scripting Language" Most Like Java and Still Known

Gary Furash
Greenhorn

Joined: Nov 03, 2010
Posts: 13
Like all developers (or just power users), I have pretty frequent need to automate things. Java itself is often too much - it doesn't need compiling, to be super robust, etc. Maybe it's just a one time. BASH, PERL, PYTHON, and RUBY have all been suggested to me, but they're not really anything like Java. I'm aware that there are Java-like scripting languages (Beanshell, Groovy, etc.) and also JavaScript scripting languages (Rhino, etc.) - JavaScript is pretty ubiqitous for the web.

Given the above, has anyone have any POSITIVE experiences with either the java-like scripting languages or the java-script desktop scripting languages?

THANK YOU
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61206
    
  66

Groovy is the one that matches your Java-like criteria most closely.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sam Saint-Pettersen
Greenhorn

Joined: Mar 27, 2012
Posts: 7

I've experimented with Groovy and Jython in Java/Scala and found both pretty straightforward to integrate. Especially Groovy if I remember correctly. I also liked Groovy in a JVM environment because it was a very Java-implemented way of doing things.
Gary Furash
Greenhorn

Joined: Nov 03, 2010
Posts: 13
Thank you. Groovy sounds like a good choice. Do you know if you can do something like force a "strict" syntax so you don't get into the habit of using it's admittedly nice syntactical sugar.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38840
    
  23
I think that discussion would fit better into our Groovy forum. Moving.
chris webster
Bartender

Joined: Mar 01, 2009
Posts: 1706
    
  14

Gary Furash wrote:Thank you. Groovy sounds like a good choice. Do you know if you can do something like force a "strict" syntax so you don't get into the habit of using it's admittedly nice syntactical sugar.

Why would you want to do that? The whole point of Groovy is it allows you to do things much more easily than in Java, so why try to turn it back into Java? You're much better off learning to write idiomatic Groovy so you can take full advantage of all that "syntactic sugar".

Also, there is nothing in principle to stop you mixing Java and Groovy code in your project, as well as using it as a very flexible stand-alone scripting tool that still gives you direct access to the full power of Java's libraries. And Groovy is also the basis for the excellent Grails web application framework (think Rails for Java). One other perceived advantage of Groovy over JVM ports of other languages such as Jython or JRuby is that Groovy is an "indigenous" JVM language, so you know you're always dealing with the definitive implementation. And the name is much, well, groovier...

For a quick intro to the benefits of Groovy for Java developers, check out Ken Kousen's video on Improving Java with Groovy. And give Groovy a try - I'm sure you won't be disappointed.


No more Blub for me, thank you, Vicar.
Gary Furash
Greenhorn

Joined: Nov 03, 2010
Posts: 13
You won't get any argument from me on the quality of Groovy and it's niftyness as a language. I helped some time back (3+ years ago) with testing and docs (once, but it was still fun). But, I haven't really seen it used since then nor heard as much about it in the marketplace. It's good to know it's still popular.

I'd only use "strict" because I'd just want to avoid "bad habits" when I have to do my java (e.g., using the easier syntax and waiting for an error in my IDE).

No argument on Groovy itself though, and you're probably right that the limited number of syntactical differences won't screw up my normal programming.
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

I have definitely been impressed by the ease of parsing JSON, XML using the Slurpers provided. And it doesnt have a long learning curve.


Mohamed Sanaulla | My Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Non-Java "Scripting Language" Most Like Java and Still Known