Groovy vs. Kawa smackdown ;-) (was Re: Java array class is not kawa Class?)

Per Bothner per@bothner.com
Mon Mar 3 03:10:00 GMT 2008


Jim White wrote:
> As you well know, I'm a long time Lisper and Kawa supporter, but 
> S-expression notation is just not gonna get most folks excited.

I have mixed feelings about S-expressions, myself.  I like having an
extensible syntax and no reserved identifiers.  Otherwise, I'd like to
make parentheses optional except for grouping.  (If you start Kawa
with the --q2 switch, you get an experimental hybrid line-oriented
syntax, but it's too incomplete/inconsistent for real use.)

One way in which Kawa is more compact than Groovy is in property acesses
and "beans".  From http://groovy.codehaus.org/Groovy+Beans

Groovy:
         Customer customer = new Customer();
         customer.setId(1);
         customer.setName("Gromit");
         customer.setDob(new Date());

         println("Hello " + customer.getName());

Kawa:

(define customer (Customer id: 1 name: "Gromit" dob: (Date)))
(format "Hello %s%~" customer:name)


Class definition:

(define-class Customer ()
   (id :: <integer>)
   (name :: <string>)
   (dob :: <java.util.Date>))

However, I agree that Groovy seems a nice enough language, with
some nice ideas.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/



More information about the Kawa mailing list