|
Thursday, December 11, 2003 |
It seems to have taken way longer than it should but the first beta release of Groovy is out! Download it here.
This release includes...
- compile time or runtime compilation straight to Java bytecode as well as groovyc Ant task and command line script
- a Swing based console (groovyConsole) and a simple command line terminal (groovysh) complete with typeo :)
- full support for properties, fields, native syntax for maps, lists, regex and autoboxing
- 'true' closures (like Ruby 2.0), static or dynamic typing, operator overloading, text templating
- GPath (a native XPath like language)
- GroovyMarkup for embedding structured markup inside Groovy with support for markup, DOM, SAX, Swing and Ant scripting
- Groovlets - a neat way of writing Servlets using groovy
Please be gentle with it, its the first ever official release. All feedback welcome.
8:32:10 PM
|
|
aint that cute :)
1:34:48 PM
|
|
I've been looking at lots of languages for inspiration for Groovy
lately so read up a little on C#. There's some nice things in there -
metadata, autoboxing, operator overloading - though there's a few
things I'm not too keen.
virtual keyword
First off the virtual keyword. I remember many many times in the old
C++ days where someone would forget to add a virtual keyword on a
method, meaning you couldn't override something and you couldn't change
it without breaking binary compatibilty and you had to hack around it
causing much pain. Usually this was all caused by someone just plain
forgetting to add the keyword.
I much prefer Java's approach of you lock something down when you
decide you want to (rather than having to remember to open something
up). Afterall its much more common for things to be left open than
things to be explicitly closed. e.g. go through the JDK; there's very
few uses of final and quite right too.
I can't remember ever hitting developer pain in Java when someone
accidentally made a method overloadable causing problems - though I
still, after 6+ years of java, remember the not-overloadable-pain of
C++ and it seems C# has followed suit unfortunately. Sure leaving
things open can lead to the fragile base class problem - but thats something for the person overloading your code to worry about.
Modern VMs are totally capable of inlining virtual method calls if
they're in a hotspot - we shouldn't have to worry about helping the VM
squeeze out small percentages of performance improvements - we should
be aiming for reducing developer pain. Incidentally its been a while
since any application I worked on was CPU bound too; these days its
most IO bound, often database bound.
taste
A quick point on taste: I really dislike the Capital Letters For Method
Names. object.Print() is just ugly - coming from a C++, Java,
Smalltalk, Ruby or Python background this just jolts the senses;
capitals are reserved for types (well apart from Python maybe). I
wonder why they chose that? Was is just to make C# code look more
different to Java? A bit like using instead of / for path separator
or something? Or to make VB people happy? I'm sure C# developers will
have got used to it by now - its like all those folks who drive on the
wrong side of the road :) but as someone who doesn't work on the dark
side, it looks ugly over there :)
override
Anyways the other thing I find interesting is the override keyword. You can read the argument for its inclusion here.
The thing I find totally amazing is in 12-15 years of C++ and 6+ years
of Java I've never ever hit the problem they're talking about. Maybe
I've been doing something really wrong the last (ahem) nearly 20 years
(crikey how time flies) or could it be they've added a language feature
that adds yet more baggage for the developer for very little actual
gain?
summary
I'm with Matz on this;
languages these days should be about making developers lives easier and
fun, removing baggage not adding it, since developers are the expensive
resource - let the language & compilers & runtime do more of
the work for us. A few things in C# I see as a step backwards from Java.
10:17:00 AM
|
|
I Folks like me turn the unread news in my news aggregator into a big blob of HTML and sync it with my PDA
so I can catch up on the blogosphere while commuting to work or
travelling. Its a little annoying when many movable type blogs only
include, say, 100 worlds of the post - you often find that when you're
back online & if you remember to go back and look that you only
missed 2 words afterall :)
Most RSS feeds give you the whole post, so its really neat for offline
reading of news. If you're a MovableType blogger, please take pity on
us offline-news-readers and enable your full posts to be in your RSS
feed. To do this...
Edit your template for your RSS 1.0 feed (index.rdf) and
look for <$MTEntryExcerpt...$> tag. Merely change it to be
<$MTEntryBody...$>, save your template, and rebuild your site.
Many thanks!
9:51:38 AM
|
|
© Copyright 2007 James Strachan.
|
|
|
|
|
|
December 2003 |
Sun |
Mon |
Tue |
Wed |
Thu |
Fri |
Sat |
|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
|
|
|
Nov Jan |
|
|
|
|
|
|