From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3ccb707f4c91a5f2 X-Google-Attributes: gid103376,public From: rogoff@sccm.Stanford.EDU (Brian Rogoff) Subject: Re: Java vs Ada 95 (Was Re: Once again, Ada absent from DoD SBIR solicitation) Date: 1996/10/16 Message-ID: #1/1 X-Deja-AN: 189888752 references: <325D7F9B.2A8B@gte.net> organization: /u/rogoff/.organization reply-to: rogoff@sccm.stanford.edu newsgroups: comp.lang.ada Date: 1996-10-16T00:00:00+00:00 List-Id: bobduff@world.std.com (Robert A Duff) writes: In article , Brian Rogoff wrote: >To which I would add "hierarchical package system", though I'm sure someone >out there must feel that this is also bad! This would approximate my short >list of Ada advantages over Java. Besides GC, which is arguable, no one has >listed any *language* advantages of Java over Ada. How about portability of arithmetic? That's another, very minor IMO, advantage. The people who worry most about this issue are doing systems or numeric programming. Java is unsuitable for those applications in its current state anyways. For writing applets and such stuff, the number sizes don't interest me too much. Of course it is important so that the byte code can run on all machines, just not important to me when I am coding in Java. Also, this is really only an advantage when coding for the JVM. If you do happen to work on one of those weird architectures for which the number sizes may not be mapped well, an Ada compiler will not be hamstrung by this restriction. This may be nitpicking though. In Java, int is always exactly 32 bits 2's complement. In Ada, Integer is whatever the machine supports. And if I say "type T is range 1..100;" I might get 32-bit arithmetic, or I might get 8-bit arithmetic, or who-knows-what. In Java, 64-bit integers are supported, and no more. In Ada, 64-bit integers are supported by GNAT, but not by other compilers. So, it is also a disadvantage, in that you can't have 128 bit integers :-). Or you could, if you want them to be heap allocated, GC'ed beasties that don't have standard math operators. A compiler could support more, or less, according to its whim. Is "type T is range 1..10**10;" legal? It is on *some* Ada compilers, but not others. On the other hand, at least Ada notifies you of overflows -- in Java, it just silently gets the wrong answer. (This is the C and C++ culture -- Java inherits much more than just syntax from that culture.) In fact, as a non-technical advantage, Java's !@#$ing C-like syntax probably overwhelms most of the technical advantages being discussed. To be fair though, I'll count "portability of arithmetic" as a Java advantage. -- Brian