What’s in a syntax?

I was looking at JGA earlier. Basically yet another instance of the JGreenspun pattern. I have my own implementation of the same sort of thing – JGA looks significantly better than mine frankly.

But, even with a nice terse syntax, the kind of shenanigans one has to go through to make it work are pretty horrible. Take a look at some of my code snippets if you don’t believe me (granted the snippets I had are not very terse, but due to heavy use of anonymous inner classes one is pretty stuck with using constructors, which with abundant generics quickly leads to some really horrible lines). Although you can get most (well, about 75%) of the functionality of a functional language like ML or Haskell into Java if you hammer enough, the result is fairly mindly blastingly horrible.

Shorter syntax for declaration of anonymous inner classes would certainly help a bit, but I don’t think it’s really going to be enough. I think that until closures come along to Java (and I mean proper BGGA style closures. Anonymous inner classes just aren’t going to cut it) I’m going to have to revert to the way of doing things that doesn’t involve too much greenspun. And/or defect to Scala completely.

This entry was posted in programming and tagged , on by .