2005-03-31

Ada and Java

Quoth Tim Bray in his post on Jini and the Tokyo Subway (cool maps, of course):

[Jini is] overkill. It’s OSI networking, and we need TCP/IP. It’s Ada and we need Java.

As usual, I'll pick on a throwaway point in someone else's posting, in this case the relationship between Ada and Java. There actually is one:

Tucker Taft's wonderful, if stupidly named, paper "Programming the Internet in Ada 95" (PS, PDF) is all about the Intermetrics implementation of Ada on the Java Virtual Machine. Semantically, the two languages are very, very close.

I am particularly kraked (the opposite of karked) by the following paragraph:

As a final anecdote, we have already found the combination of the two technologies to be uniquely productive. We have been able to develop applets in Ada 95 that are just as functional as corresponding Java applets, and that take full advantage of the standard Java library. Furthermore, with one applet that we translated, after implementing full constraint checking in the Ada to Java compiler, we immediately began to reap the benefits of Ada's notion of range checks. The first Constraint Error that was raised identified a small error in the hand translation from the original Java applet into Ada. After fixing that error, the next Constraint Error raised identified a deep logic error in the original Java applet, which ultimately turned out to be due to the randomization mechanism used to initialize the game.

Moral: If you are going to create a statically typed faschochauvinist programming language, do it right. Or more tunefully, "Everything Java does, Ada does better / Everything Java does, Ada can do."

For you younkers that have never seen Ada code, here is the Hello World applet(only 16 lines, and it's graphical). Much more at The Home of the Brave Ada Programmers, Java Section, including the priceless line "Java [is] a language derived from C++ but modified so as to be closer to Ada 95 (on purpose or not, it does not really matter; they wanted a better language than C++ and ended up moving closer to Ada 95)".

No comments: