Updated: A day (wasted?) with Groovy


Update: After staying up late (after 2am after the clocks went forward), I found various bugs – I don’t know if these reflect underlying changes in the language or the JVM in the interim but it seems to work now (see GIF of the Game of Life below). Working on getting the jar done too so it becomes easier for others…

There has been a small revival of interest in the wonders of 8 bit computing lately and I thought now would be a good time to revivify the BINSIC project. But has all proved to be a highly frustrating waste of time.

BINSIC – BINSIC Is Not Sinclair Instruction Code – was my 2012 project to build a DSL in Groovy that would allow users of modern computers to write and run ZX80/81 BASIC. I wrote it to explore whether it was really easier to make instructive programs that explored basic mathematical and scientific problems back then.

The first problem I had was that Groovy (and this behaviour wasn’t advertised as far as I could see) simply would not run code written in block capitals. So a DSL was essentially out and I had to write something that was more (much more) like an interpreter.

But it worked, mostly, and I had some fun with it, turned it into a jar file and forgot about it.

Unfortunately the machine hosting the jar file is gone and I never got around to trying to rebuild it – until today. And now I find the code from 2012 just won’t work.

If I try to run that code I get this:

Why code that ran a few years ago won’t run now is a mystery, but replacing the empty element in the list will get it to run – a bit – and this gets me something from the Game of Life I wrote in BASIC:


But again something that worked well 8 years ago now breaks the system:

On top of all that I seem unable to build a jar file on the command line, unable to install Eclipse and unable to get NetBeans, which will let me install a Groovy plugin but not use it, to work properly.

Is Groovy dying?


English: Logo of the Groovy project
English: Logo of the Groovy project (Photo credit: Wikipedia)

A few years ago, on my Computer Science MSc, there was something of a mini-revolt as some of the students – already working as developers – complained that the object-orientated design course was being taught in Groovy – a JVM-based language that, in effect, is a dynamic extension of static Java. They said there were no jobs in Groovy so why were we being taught that?

I wasn’t one of them. I wasn’t (and I am not) working as a developer and so Groovy, which crossed the boundaries between Java’s imperative and Scala‘s functional approaches was interesting and powerfully expressive. But, yes, it was a bit of a niche.

I have come back to Groovy now because, for my PhD, I want to write a more powerful and dynamic NoC simulation than has proved possible in C++. Groovy has the tools – especially closures – that allow the writing of good DSLs and so was a natural choice.

But the Groovy landscape seems barren. As I write I haven’t been able to make any progress on my code because it seems a Java update broke Groovy support and, because the infrastructure for Groovy support through http://groovy-lang.org appears to have collapsed.

I have asked a question on Stack Overflow:
http://stackoverflow.com/questions/37363077/groovy-eclipse-reporting-bug-following-java-update but traffic is light.

%d bloggers like this: