Re: Integers on 64-bit machines

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Thu, 05 Jul 2007 17:44:01 -0800

          From comp.compilers

Related articles
Integers on 64-bit machines dwashington@gmx.net (Denis Washington) (2007-07-02)
Re: Integers on 64-bit machines torbenm@app-3.diku.dk (2007-07-04)
Re: Integers on 64-bit machines marcov@stack.nl (Marco van de Voort) (2007-07-04)
Re: Integers on 64-bit machines emailamit@gmail.com (Amit Gupta) (2007-07-05)
Re: Integers on 64-bit machines DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-07-05)
Re: Integers on 64-bit machines anton@mips.complang.tuwien.ac.at (2007-07-05)
Re: Integers on 64-bit machines mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2007-07-05)
Re: Integers on 64-bit machines gah@ugcs.caltech.edu (glen herrmannsfeldt) (2007-07-05)
Re: Integers on 64-bit machines bobduff@shell01.TheWorld.com (Robert A Duff) (2007-07-05)
Re: Integers on 64-bit machines marcov@stack.nl (Marco van de Voort) (2007-07-06)
Re: Integers on 64-bit machines DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-07-06)
Re: Integers on 64-bit machines DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-07-06)
Re: Integers on 64-bit machines DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-07-06)
Re: Integers on 64-bit machines anton@mips.complang.tuwien.ac.at (2007-07-06)
[14 later articles]
| List of all articles for this month |

From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Thu, 05 Jul 2007 17:44:01 -0800
Organization: Compilers Central
References: 07-07-007 07-07-014 07-07-017
Keywords: types

Hans-Peter Diettrich wrote:


> Sized types primarily are required for processing data, which are
> stored in legacy formats (like API function arguments).
(snip)


> AFAIR Integer*4 was the most frequently used
> data type in scientific Fortran libraries (IMSL...), since decades.


Well, Fortran requires the default INTEGER and default REAL to have
the same size (so that EQUIVALENCE works). Some compilers on 16 bit
machines didn't do that, others store 16 bit integers in 32 bits.


> File sizes, however, already require more than 32 bits, so this may be
> another mandatory type, to be implemented for every target machine.


(snip)


> Another model is the digit count, as known from COBOL, and occuring in
> formatted output in most programming languages. These approaches are
> quite self-documenting :-)
(snip)


In some cases you know how big the value in a variable could
possibly be with useful data, other times you don't want to
unnecessarily restrict the user, and a convenient default word
size is nice.


(snip)


> [Defining the range for each variable is one of those ideas that seems
> like a good idea but in practice, programmers don't do it. In Multics
> PL/I programs, all the variables were FIXED INT(35) because everyone
> knew that was how you got a word variable. On IBM mainframes, they
> were all FIXED INT(31). -John]


I agree. Having the ability to specify it is nice, and sometimes
useful, but more often one want a convenient size. (By the way,
I think you meant FIXED BIN(31)). If the default width and scale
factor are carefully selected, and those are used, it might not
be so bad.


-- glen



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.