Share the article!
James Strachan continues his discussion about extending the Java language. He points to an interesting wiki entry Java Three. The wiki has a wealth of ideas on how to extend the Java language.
I’ve found 2 other proposals, the first is Godiva, (most likely named after the chocolate brand). Notable features include, optional semicolons, the return of functions, arbitrary precision primitives, python like indices for Strings, python like support for Lists, associative arrays, support for sets, multiple inheritance, shallow and deep assignment and comparison, aggregate operations, goal directed expression evaluation, generators, control backtracking and pattern directed matching,
The author concludes “Java’s design is elegant in comparison with most languages, but it is a spartan elegance. Java’s lack of higher-level features, aside from classes, makes a fine philosophical stand, and if one ignores the mountain of class libraries Java is fairly easy to learn, as was Pascal. We contend that this spartan elegance is unnecessary, and have attempted to prove so in a language design without losing sight of Java’s main assets.”
I couldn’t find an implementation, it looks like more of a work in progress. However, there’s at least a YACC grammar.
Another proposal is Bali (Java with a Spoonful of Syntactic Sugar). Notable features are canonical counting for loop, relaxed semicolon rules, optional named end statements, c%23 like properties, uniform collection access, enumerations, augments, constructor shortcut, for each, null method shortcut, conversions, symmetric if then/else, explicit concatenation operator, primitive object methods, and unit of measure.
The author reasons “Bali is a proposed set of additions to Java to make the language terser and safer. Terseness makes the language easier to read, write and maintain…Further languages should be pronounceable. To the human mind, unpronounced punctuation is just so much annoying fluff“
Again, no implementation, but the author is soliciting ideas.
My question is, “Which affords a greater productivity gain, syntactic sugar or a capable syntax aware editor like we see in Eclipse or IDEA?”. Having both would be nice, however changing the language would be more painful. That is, the compiler and IDE developers will need to rework their products. Furthermore, which features would we add would be result in endless debate.
One idea that may be interesting is the idea of multiple textual views of source code (i.e. Syntactic Views). Not unlike, Togethersoft’s product w/c gives you UML views of the underlying source code. However, these views would be code, and they would be high level with all the syntactic sugar you could possibly want. In this way, compatibility is not lost, at the same time we can work on any “view” that you’re comfortable with. High level syntactic views would be compiled to basic java code, and just like TogetherJ, roundtripping would be automatic.
Share the article!