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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Portability of Arithmetic (was: Java vs Ada 95) Date: 1996/10/19 Message-ID: #1/1 X-Deja-AN: 190583443 references: <325D7F9B.2A8B@gte.net> <1996Oct15.174526.1@eisner> <32679C86.2FB8@watson.ibm.com> <3268573F.41C6@cray.com> organization: New York University newsgroups: comp.lang.ada Date: 1996-10-19T00:00:00+00:00 List-Id: Brian, speaking from the high end at cray.com, notes that 64-bit integers are definitely of use in high end applications. I certainly don't disagree with that, and that is why ALL versions of GNAT on ALL machines fully support at least 64-bit signed and unsigned arithmetic. I think it would be a GOOD THING if all Ada compilers (and all C compilers for that matter) supported 64-bit integers. The interesting thing is that obviously there has not been too much pressure in the past for this, since almost all Ada 83 compilers and almost all C and C++ compilers for 32-bit machines do NOT support 64-bit integers, even though it is really pretty simple to do. So from that I conclude that at least in the past it has not been a major requirement. The reason that Ada, including Ada 95, was conservative in such requirements at the language level was that there was concern that on small embedded systems (e.g. the Patriot 2 implementation), it would be too much of a burden to make this a requirement. Note that any full language implementation of Ada 95 (you already know my definition of this term, it means that everything in the RM is implemented including all the optional annexes), you do have 64-bit integer arithmetic since you can say: type Big_Int is delta 1.0 digits 18; and that maps typically into 64-bit binary arithmetic, or in any case is presumably enough to provide for large file offsets. For the moment at least files that are a million terrabytes long are presumably sufficient :-) Note incidentally that this shows an interesting advantage of the optional annexes. Here is a case where you can write an application that deals with giant file offsets, and will still be portable to any full language implementation of Ada 95 that includes the information systems annex. Now you might have decided up front that you did not need this annex, but it is often the case that facilities in one of the optional annexes turn out to be helpful in all sorts of contexts. For example, you may find the 'Body_Version attribute useful in tagging files to make sure that they are read by an appropriate version of your software, evenb though you have ZERO interest in distribution otherwise, or you may want to use pragma Normalize_Scalars to help you track down bugs even if you are not writing Safety-Critical software and do not need other features in the safety and security annex. There are many other examples! Of course in GNAT, you could simply use Long_Long_Integer, knowing that it is at least 64-bits, but that might not be portable to another Ad 95 compiler, even one that did implement the full language, including all the annexes.