[JSR308] Can we agree on our goals?

Gary T. Leavens leavens at cs.iastate.edu
Thu Feb 1 14:48:10 EST 2007

Hi Neal, and all,

I think getting an agreement on goals is a good idea.

As far as I know from the draft, it's in the charter of the JSR to
look at annotations on statements.

For my part, I would be very happy with adding the ability to have
annotations on types and statements (or even just loop statements).
I'm not personally trying to use any kind of strategy to lead us down
a slippery slope towards annotations on all possible syntactic
categories.  I think if Java programmers can annotate declarations,
types, and (loop) statements, that will be plenty.

Again, I think an argument can be made that not allowing annotations
on statements will be more confusing to users and cause the proposal
to be less regular/uniform than it would be with them.  We shouldn't
measure complexity just by the size of the grammar or the length of
our document.

On Thu, 1 Feb 2007, Neal Gafter wrote:

> I think the right way to design a language with a general annotation
> facility is to support (or at least consider supporting) a way of annotating
> every semantically meaningful nonterminal. Doing that requires a language
> design with a very simple syntax. Java isn't syntactically simple, and I
> don't think there is anything we can do it make it so. If we wanted to take
> this approach with Java we'd have to come up with a syntactic solution for
> every construct that we want to be annotatable. Given the shape of the Java
> grammar, that solution would probably be a different special case for every
> thing we might want to annotate. From the programmer's point of view, I
> believe the result would be a mess. It is hard for me to imagine that we
> could get such a thing passed and included in Java.
> It scares me that I see, in the draft spec and in the discussion here, the
> group going down that slippery slope one language construct at a time. That
> is way too complex to be practical. Part of the problem is that we don't
> appear to have agreed upon our goals! I thought our goal is to support
> annotations on types. That is a single (+-10) semantically meaningful
> nonterminal in the language, and there is a simple, unambiguous, and uniform
> syntactic solution that works for all types appearing in the sources. I'm
> referring to the postfix "annotation after the type" solution. We know this
> doesn't satisfy every requirement in the world, but no specification will.
> Simple is good, and it feels to me like most of the proposals more complex
> than this are actually trying to expand the scope of our charter.

         Gary T. Leavens
         Department of Computer Science, Iowa State University
         229 Atanasoff Hall, Ames, Iowa 50011-1041 USA
         http://www.cs.iastate.edu/~leavens  phone: +1-515-294-1580

More information about the JSR308 mailing list