Re: What attributes of a programming language simplify its use?

anton@mips.complang.tuwien.ac.at (Anton Ertl)
Wed, 07 Dec 2022 10:14:44 GMT

          From comp.compilers

Related articles
[2 earlier articles]
Re: What attributes of a programming language simplify its use? tkoenig@netcologne.de (Thomas Koenig) (2022-12-03)
Re: What attributes of a programming language simplify its use? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2022-12-03)
Re: What attributes of a programming language simplify its use? christopher.f.clark@compiler-resources.com (Christopher F Clark) (2022-12-03)
Re: What attributes of a programming language simplify its use? gah4@u.washington.edu (gah4) (2022-12-03)
Re: What attributes of a programming language simplify its use? Keith.S.Thompson+u@gmail.com (Keith Thompson) (2022-12-06)
Re: What attributes of a programming language simplify its use? gah4@u.washington.edu (gah4) (2022-12-06)
Re: What attributes of a programming language simplify its use? anton@mips.complang.tuwien.ac.at (2022-12-07)
Re: What attributes of a programming language simplify its use? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2022-12-07)
Re: What attributes of a programming language simplify its use? Keith.S.Thompson+u@gmail.com (Keith Thompson) (2022-12-07)
Re: What attributes of a programming language simplify its use? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2022-12-08)
Re: What attributes of a programming language simplify its use? gah4@u.washington.edu (gah4) (2022-12-08)
Re: What attributes of a programming language simplify its use? gah4@u.washington.edu (gah4) (2022-12-12)
| List of all articles for this month |
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.compilers
Date: Wed, 07 Dec 2022 10:14:44 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
References: 22-12-001 22-12-003 22-12-004 22-12-007 22-12-008
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="95306"; mail-complaints-to="abuse@iecc.com"
Keywords: design, types
Posted-Date: 07 Dec 2022 11:44:50 EST

gah4 <gah4@u.washington.edu> writes:
>In the early days of 64 bit computing, which I mostly remember from
>the DEC Alpha, C compilers made long the 64 bit type.


The early days of 64-bit computing are on the CDC Star and Cray-1, but
C was a minor language for them.


Yes, we got the first mainstream 64-bit Unix with Digital OSF/1 on the
Alpha, and 64-bit APIs and ABIs on Unix had 64-bit long.


>That, then, broke too much software assuming long was 32 bits.


Obviously not, or other Unix vendors would not have also made longs
64-bit in their interfaces.


>So then we got long long as the (close enough to) reliable 64 bit
>type.


GCC introduced long long indepenently of any 64-bit port; this is easy
to see because the original GCC documentation specified that long long
int is twice as long as long int. Later, when the Alpha port (and
later 64-bit ports) came, the porter decided to make long long 64-bit,
i.e., the same size as long; I don't know if the Alpha API/ABI had a
requirement on the size of long long, or if the people responsible for
the Alpha port did deviate from the documentation for some other
reason. When we reported this as a bug, the fix was to change the
documentation to say that long long is twice as long as int.


Concerning IL32P64, i.e., 32-bit longs with 64-bit pointers, that
seems to be a specialty of 64-bit Windows. Fortunately, I don't have
to deal with this API (64-bit Cygwin supports the Unix API, i.e.,
64-bit long).


>Maybe in a few years, we will have the long long long 128 bit type.


GCC has supported 128-bit integers for a while, originally we wrote,
e.g.:


typedef int int128_t __attribute__((__mode__(TI)));


(makes me wonder how the compiler sees the "TI"; it's not a keyword,
and it's not a defined name in any of the name spaces; gcc tends to
pass such things as literal strings (cf. extended asm), but here it
does not).


Nowadays it seems to (also) have __int128_t as an
implementation-specific keyword. I see no motions in the direction of
long long long (and, looking at history, it would only have 64 bits in
length:-).


- anton
--
M. Anton Ertl
anton@mips.complang.tuwien.ac.at
http://www.complang.tuwien.ac.at/anton/


Post a followup to this message

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