3

I'm trying to choose between groovy and beanshell, I need one that is in active development, is moderately fast, can access/interpret java code and support restriction to which java classes it can access in my internal code. I'm not sure if beanshell is still in active development. Please advice me.

Thank you.

John
  • 41
  • 2

3 Answers3

7

Looking over the beanshell.org archives, it looks like it hasn't been under really active development since 2005. The developer mailing list hasn't had any traffic since January 2009. It's possible that the work has moved elsewhere, of course, but I can't see any obvious destinations...

Groovy is definitely under active development.

(Disclaimer: as someone involved in the Groovy in Action book, I have a certain amount of bias... but I don't actually use Groovy on a regular basis; it's not like I have an axe to grind :)

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • 1
    Its nice to see a C# guy explaining about Groovy ;) ;) – Ant's Jul 30 '11 at 13:10
  • @Jon Don't confuse active development with smoke-and-mirrors marketing buzz, which Groovy has plenty of. – Vorg van Geir Jul 31 '11 at 03:50
  • 1
    @Vorg: Well, I'm seeing a pretty active SVN log. Are you suggesting that Groovy *isn't* under active development, and that the SVN commits are somehow irrelevant or fake? – Jon Skeet Jul 31 '11 at 06:54
  • @Jon I don't see any activity on the Groovy SVN log (http://svn.groovy.codehaus.org/changelog/groovy) since Sep 2005. – Vorg van Geir Aug 01 '11 at 14:21
  • @Vorg: You're looking at the wrong repo. `svn log http://svn.codehaus.org/groovy` (In both Groovy and Beanshell, I simply followed the links on the homepages to get to the repositories.) – Jon Skeet Aug 01 '11 at 14:25
  • @Vorg: See also http://docs.codehaus.org/display/GROOVY/2011/07/21/Groovy+1.8.1+update+and+first+beta+for+Groovy+1.9 - Groovy 1.8.1 was released less than 2 weeks ago. – Jon Skeet Aug 01 '11 at 14:28
  • Looks pretty active to me: https://jira.codehaus.org/browse/GROOVY 51 bugs created and 41 resolved in the last 30 days (Aug 5, 2011). – Andrew Eisenberg Aug 05 '11 at 18:16
  • @Vorg, just take a look at the roadmap: http://groovy.codehaus.org/Roadmap you will see the all the releases and what's coming on. – z-index Aug 06 '11 at 05:05
2

Below are the differences i found between groovy and beanshell

I would prefer groovy for my development as its serves my purpose wherein it can execute a script written in beanshell.

Anyways below are the observations i found when i evaluated Groovy 2.0.0 agains Beanshell 2.0b4

Both these scripting languages has syntax similar to Java.

Groovy

  1. Groovy engine can run a script written for beanshell
  2. Execution environtment is java 1.5 . developed on JDK1.5
  3. Supports Generics and collections with generics. Also suports raw types eg> ArrayList str = new ArrayList()

  4. Supports calling methods with variable arguments eg. method(int...i)

  5. Supports primitive data types like int to assign 4 byte hexa-decimal values eg. int i = 0x80018000;
  6. The syntax for array initialization is bit dffierent from java eg. In java, array is initializzed as int[] array = {1,2,3}; In groovy, its is done as int[] array = [1,2,3];
  7. Supports for loops and for each loops etc

BeanShell

  1. Beanshell cannot run the script written for groovy as it is based on JDK1.4. so no generic features
  2. Execution environtment is 1.4 or more but doesnt support generics
  3. Doesnt support generics. only raw types are supported
  4. Doesnt support writing a method with variable argumnets or calling a method with variable arugments
  5. Doesnt support assinging certain hex decimal values to the primitive data types eg int i = 0x80018000 throws an exception from the beanshell interpreter saying the size is big A BigInteger is to be used in this case which is again tedious as we have to do something like this BigInteger i = new BigInteger("0x80018000");

        This problem occurs even if we declare long i = 0x80018000
    
  6. Syntax for array initialization is similar to java.
  7. Supports for loops and for each loops etc
user1821083
  • 71
  • 1
  • 5
0

It appears that Beanshell is under development lately and will be integrated into J2SE at some point. I would vote for Beanshell over Groovy, the most important reason being that it is a bit more straight forward instead of having the learning curve of trying to learn all of Groovy's unique syntax, making it almost like learning a new language.

djangofan
  • 28,471
  • 61
  • 196
  • 289