Prev: FYI -- Lunar lander project relies on SPARK programming language
Next: Simple hack to get $500 to your home
From: Randy Brukardt on 11 Jun 2010 15:05 "Maciej Sobczak" <see.my.homepage(a)gmail.com> wrote in message news:3133a7d5-37ec-4db7-94f0-df15b3535af1(a)k39g2000yqb.googlegroups.com... > On 11 Cze, 09:07, "Jeffrey R. Carter" <spam.jrcarter....(a)spam.acm.org> > wrote: .... > I have seen this argument raised many times already, but it was never > substantiated in terms actual risk estimation. > Could you please list the compilers that do not implement this type? The only predefined integer types in recent versions of Janus/Ada are Integer and Long_Integer. Janus/Ada also has a type System.Byte for compatibility with our Ada 83 compiler, and of course the various types in package Interface. I've never seen "Short_Short_Integer" in any Ada compiler (not that I've been looking). Of course, you can explicitly define an 8-bit signed integer type, but we don't predefine one (it's not very useful); Integer is 16-bit [for compatibility with our compilers going back to the beginning of time, on the 8080/Z80], and Long_Integer is 32-bit. Randy.
From: BrianG on 13 Jun 2010 00:26 Maciej Sobczak wrote: > On 11 Cze, 09:07, "Jeffrey R. Carter" <spam.jrcarter....(a)spam.acm.org> > wrote: > >> Implementations are not required to define Short_Short_Integer (or any other >> predefined integer type except Integer), so the program may fail on other >> compilers. Thus, the use of Short_Short_Integer is not portable. > > I have seen this argument raised many times already, but it was never > substantiated in terms actual risk estimation. What do you mean by a risk estimate, a probability for this particular type? I would doubt anyone would have surveyed all Ada compilers just to generate that number. More generically, I can only duplicate when Jeffrey said: If you use a type provided by your Ada compiler that is not defined in the Ada RM, you cannot presume that that type is provided by a different compiler. (I don't see how this would be different from the same situation in any language. For example, how many C++ compilers don't implement a type named Short_Short_Integer?) > Could you please list the compilers that do not implement this type? All that do not claim to implement it. > > Or is there somewhere a public list of such incompatibilities? What incompatibilities, incompatible with what? Might you mean Ada'95/05 RM 3.5.4(25) "An implementation may provide ..." (the only use of that name I could find in either document)? How can any Ada compiler be incompatible with that? > > -- > Maciej Sobczak * http://www.inspirel.com > > YAMI4 - Messaging Solution for Distributed Systems > http://www.inspirel.com/yami4 --In a world where I feel so small -- I can't stop thinking big...
From: Maciej Sobczak on 13 Jun 2010 14:07 On 13 Cze, 06:26, BrianG <briang...(a)gmail.com> wrote: > What do you mean by a risk estimate, a probability for this particular > type? The likelihood of getting into trouble by using this type. (I use the word "likelihood" instead of "probability" as this obviously cannot be expressed with a single number.) > I would doubt anyone would have surveyed all Ada compilers just > to generate that number. Because there are so many Ada compilers? > (I don't see how this would be different from > the same situation in any language. For example, how many C++ compilers > don't implement a type named Short_Short_Integer?) Well, here the situation is a bit easier, as no C++ compiler at all implements a type named Short_Short_Integer. However, you might take this page for comparison: http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport It presents the compatibility chart for new language features - that is, it provides the information on which compiler supports which feature. As you see, making such a list is possible. I hope that this example will explain what kind of information I'm looking for. > > Or is there somewhere a public list of such incompatibilities? > > What incompatibilities, incompatible with what? With Short_Short_Integer, of course. I will take the opportunity to extend my question: is there a "compatibility list" for Ada compilers with regard to all language features that are described as optional? Not just Short_Short_Integer, but also Long_Long_Integer (just joking :-) ), pragmas, annexes, etc.? -- Maciej Sobczak * http://www.inspirel.com YAMI4 - Messaging Solution for Distributed Systems http://www.inspirel.com/yami4
From: Georg Bauhaus on 14 Jun 2010 03:28 On 6/13/10 8:07 PM, Maciej Sobczak wrote: >> (I don't see how this would be different from >> the same situation in any language. For example, how many C++ compilers >> don't implement a type named Short_Short_Integer?) > > Well, here the situation is a bit easier, as no C++ compiler at all > implements a type named Short_Short_Integer. > > However, you might take this page for comparison: > > http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport I understand this nice list compares the popular PC/workstation compilers; is there a similar list for C++ compilers that includes typical Ada targets? (Maybe Windriver (EDG I understand, but...), CodeWarrior, Greenhills, ...) >>> Or is there somewhere a public list of such incompatibilities? >> >> What incompatibilities, incompatible with what? > > With Short_Short_Integer, of course. Will there be a loss of magic or purpose if you just declared the type you want, with rep clause maybe? (IOW, can't we assume that compilers will do just as good as they do for predefined types? In fact, some of the Shootout programs got better when switching to programmer defined numeric types.) If I'd need "cross language types" or "database types", then there is likely a common need and hence a community for producing a suitable package; no need to get compiler technology in the way. For example, GNADE uses 64bit types for 64bit database types. GNADE cannot be used if the compiler refuses to accept as is (one Windows compiler doesn't).
From: Keith Thompson on 14 Jun 2010 12:45 Maciej Sobczak <see.my.homepage(a)gmail.com> writes: > On 13 Cze, 06:26, BrianG <briang...(a)gmail.com> wrote: >> What do you mean by a risk estimate, a probability for this particular >> type? > > The likelihood of getting into trouble by using this type. > (I use the word "likelihood" instead of "probability" as this > obviously cannot be expressed with a single number.) You don't need to worry about the "probability" that your code is correct if you just write it to be portable and correct in the first place. Not all Ada compilers implement Short_Short_Integer, but all Ada compilers do implement: type My_Type is range -128 .. 127; [...] > I will take the opportunity to extend my question: is there a > "compatibility list" for Ada compilers with regard to all language > features that are described as optional? Not just Short_Short_Integer, > but also Long_Long_Integer (just joking :-) ), pragmas, annexes, etc.? Why the "just joking :-)" for Long_Long_Integer? It's another optional type, and some Ada compilers do implement it. -- Keith Thompson (The_Other_Keith) kst-u(a)mib.org <http://www.ghoti.net/~kst> Nokia "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: FYI -- Lunar lander project relies on SPARK programming language Next: Simple hack to get $500 to your home |