Friday, November 09, 2007

Groovy == Gr + OO + Vy

Beta 1 of the first component of Grerl will be released soon, an alternative lexer/parser for scripts. Grerl is in fact a combination of coming components for Groovy, not just the parser, but also a method-aliasing MOP plugin, an IME for CJK characters, builders for regex and JParsec, and others. When used together, they'll enable terser scripting with Groovy. I've decided to brand the parser component of Grerl as "Vy", pronounced "vee".

Why call it "Vy"?
When I first entered the ICT industry in the 1980's, it seemed every operating system had the letter V in it: IBM's VSE and MVS, ICL's VME, DEC's VMS, Wang's VS, and so on. V stood for "virtual". One real system, geared up by the software to produce many "virtual" systems. The Java Programming Language continued the tradition by choosing a name with V in it, as has Groovy.

James Strachan announced the birth of Groovy as intending to fill the dynamic language gap that J-versions of Perl, Python, and Ruby couldn't, a little over 4 years ago in his famous blog announcement. Early the following year, after much of the syntax had been solidified, the Groovy language was submitted to the Java JCP to be standardized. Development slowed down for a while, until in October 2004, Guillaume Laforge kickstarted it, as described in his brief history, interesting to read and follow the links. It was also at that time I stumbled across Groovy. Although having never worked commercially with Java, I played with Groovy for the following few years, mainly learning closures, collections, and regexes, converting my personal-use Access databases to little Groovy apps.

Version 1.0 of the language was released at the beginning of this year, though at that time, I had email-only internet access because of the earthquake, so couldn't download it for a month. I decided to contribute to Groovy by writing a first iteration of documentation for Java newbies, as I see them as an important target market for the Groovy language. Although Python and Ruby programmers mightn't be interested in it, Groovy is a step up for programmers in many other non-Java languages, and in future when Groovy's more widely used than Java, will be the main source of new users. Although I've stopped working on that doco for now, I've left it looking clean enough to be useful. Instead, a few months ago, I started working on Vy: to write terser Groovy scripts, we must be able to define our own keywords and syntax, and so need a parser that enables this.

But why call Vy "Vy"?
The "oo" in Groovy stands for the object oriented Java underneath. OO was first introduced by Simula and Smalltalk, then popularised by C++ and Java. The "Gr" stands for dynamic scripting, first popularised by Perl, polished up by Python and Ruby/Rails, then brought to the JVM by Groovy/Grails. But what is the "vy" in Groovy?

The Groovy Developers could rename version 2.0 of Groovy to something else (as has been rumored). It would have to begin with G or Gr, so existing derivatives such as Grails, Gant, and Grash are still named aptly, but it could easily drop the V. Perhaps "Grape"? As in "Grape 'n' Grails". Sounds like the name of an English pub! Groovy as it is now doesn't need the V in its name, nor is it yet providing that extra jolt to Groovy the V signifies. Groovy, Grails, etc, are presently only enabling similar functionality as other dynamic language ecosystems, only doing it for the Java platform.

There's many reasons why "Vy". The alphabetic (pinyin) representation of Chinese characters uses 25 letters, all the Latin alphabet letters except the letter V. Key to providing tersity to Grerl-enabled Groovy scripts is using all the tokens in the Unicode character set, 70% of which are CJK (unified Chinese, Japanese, and Korean) characters. Perhaps we could say that Vy completes the Chinese alphabet by allowing us to use Chinese characters easily in the Grerl/Groovy syntax.

In aeronautics, a plane's VY is the speed that gives it the best rate of climb. Grerl's Vy will be one person's first attempt to give Groovy the best rate of climb to the clouds, by increasing the tersity of the code, yet retaining its clarity. Programmers switching from other less dynamic programming languages to Groovy rather than to Python or Ruby may base their decision on how tersely they can write code. Programmers love writing terse code to do powerful things.

Even if the official Groovy name as used at Codehaus stops at the release of version 1.1, the Groovy name will always be in common use to refer to the complete ecosystem of software resulting from James Strachan's blog entry on 29 August 2003. To retire a brand is even more difficult than building one. Even the distribution of Grerl intended for Java newbies, packaging together the groovy-all jar (Gr), the Java 6 kernel edition (OO), and alternative parser (Vy), will be tagged the Gr+OO+Vy download.

Grerl's Vy is coming. Helping put the V in Groovy, giving it the best rate of climb to the Cloud.

2 comments:

Daniel.Sun said...

Hi Gavin,
"
Grerl is in fact a combination of coming components for Groovy, not just the parser, but also a method-aliasing MOP plugin, an IME for CJK characters, builders for regex and JParsec, and others. "

Will Grerl be bound in Groovy?
BTW, Grerl is very interesting for me :)

Thanks,
Daniel.Sun
http://www.blogjava.net/BlueSUN/

Gavin Grover said...

Daniel
I'm not certain on the final packaging, location, naming, licence, etc of Grerl. When it does the basic job of reading and running a script file written in Groovyish code, I'll release beta 1. Perhaps I'll apply to Codehaus.

For now, I've got a JParsec-based parser together (sans Java 5 features), mainly copied from the Antlr lexer/parser, and have hooked in most toplevel & statement AST nodes. I'm now bogged down in the expression nodes.

I'm inspired by:
(1)the future model of programming as depicted by
www.martinfowler.com/articles/workbench.gif>Martin Fowler here
, where the AST is central, and many languages/editors/workbenches can be used with it
(2)if one of those languages is CJK character based, we can write much terser code
(3)while the Groovy 1.1 language targets Java programmers, a different language syntax writing to the Groovy AST might be better for targeting non-Java programmers