Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Witch! Witch! They'll burn ya! -- Hag, "Tomorrow is Yesterday", stardate unknown


devel / comp.lang.c / Re: typedef in old C

SubjectAuthor
* typedef in old CBart
+* Re: typedef in old CThiago Adams
|`* Re: typedef in old CThiago Adams
| `* Re: typedef in old CBart
|  `* Re: typedef in old CKaz Kylheku
|   `- Re: typedef in old CThiago Adams
+* Re: typedef in old CBen Bacarisse
|+- Re: typedef in old CScott Lurndal
|+- Re: typedef in old CKeith Thompson
|`- Re: typedef in old CTim Rentsch
+- Re: typedef in old CKeith Thompson
+* Re: typedef in old Cluser droog
|`* Re: typedef in old CBen Bacarisse
| +* Re: typedef in old CChris M. Thomasson
| |`- Re: typedef in old CBen Bacarisse
| +* Re: typedef in old CScott Lurndal
| |`- Re: typedef in old CBen Bacarisse
| `* Re: typedef in old Cluser droog
|  `- Re: typedef in old CBen Bacarisse
`* Re: typedef in old CBonita Montero
 `- Re: typedef in old CKenny McCormack

1
typedef in old C

<tn9vlg$5ra$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=23981&group=comp.lang.c#23981

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!aioe.org!uabYU4OOdxBKlV2hpj27FQ.user.46.165.242.75.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: typedef in old C
Date: Tue, 13 Dec 2022 13:45:20 +0000
Organization: Aioe.org NNTP Server
Message-ID: <tn9vlg$5ra$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="5994"; posting-host="uabYU4OOdxBKlV2hpj27FQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.5.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: Bart - Tue, 13 Dec 2022 13:45 UTC

I was looking at the 1983 C sources of PostScript (via
https://computerhistory.org/blog/postscript-a-digital-printing-press/).

It uses typedef like this:

typedef long int integer;
typedef unsigned integer Offset;

That is, being able to apply 'unsigned' to a typedef-ed name, rather
than any of 'char short int long'.

I guess this is not legal C now; I just wondered at what point it
stopped being legal, if it ever was (perhaps compilers were just more lax).

Re: typedef in old C

<1b20f5a8-6319-4bda-abec-240a9ca3e979n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=23983&group=comp.lang.c#23983

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a0c:ee91:0:b0:4b4:a0b0:2dd8 with SMTP id u17-20020a0cee91000000b004b4a0b02dd8mr71244739qvr.19.1670942553636;
Tue, 13 Dec 2022 06:42:33 -0800 (PST)
X-Received: by 2002:ac8:7112:0:b0:3a8:1fbc:3b61 with SMTP id
z18-20020ac87112000000b003a81fbc3b61mr230135qto.182.1670942553425; Tue, 13
Dec 2022 06:42:33 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 13 Dec 2022 06:42:33 -0800 (PST)
In-Reply-To: <tn9vlg$5ra$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=170.231.44.126; posting-account=xFcAQAoAAAAoWlfpQ6Hz2n-MU9fthxbY
NNTP-Posting-Host: 170.231.44.126
References: <tn9vlg$5ra$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1b20f5a8-6319-4bda-abec-240a9ca3e979n@googlegroups.com>
Subject: Re: typedef in old C
From: thiago.a...@gmail.com (Thiago Adams)
Injection-Date: Tue, 13 Dec 2022 14:42:33 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Thiago Adams - Tue, 13 Dec 2022 14:42 UTC

On Tuesday, December 13, 2022 at 10:45:34 AM UTC-3, Bart wrote:
> I was looking at the 1983 C sources of PostScript (via
> https://computerhistory.org/blog/postscript-a-digital-printing-press/).
>
> It uses typedef like this:
>
> typedef long int integer;
> typedef unsigned integer Offset;
>
> That is, being able to apply 'unsigned' to a typedef-ed name, rather
> than any of 'char short int long'.
>
> I guess this is not legal C now; I just wondered at what point it
> stopped being legal, if it ever was (perhaps compilers were just more lax).

Interesting.

I have posted here a question in the past how to "merge" typedef definitions..
The separation of type specifier and declarator in C makes everything more complex.

things like:

typedef int A[2];
typedef A *B [1];

B is
int (* [1]) [2]

I think this is one of the biggest problem of C.. but this bothers more implementers.

Re: typedef in old C

<69bf93cf-c747-497f-8236-94c848b0a66an@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=23984&group=comp.lang.c#23984

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:bd01:0:b0:6ec:53ab:90ee with SMTP id n1-20020a37bd01000000b006ec53ab90eemr86498241qkf.415.1670942779251;
Tue, 13 Dec 2022 06:46:19 -0800 (PST)
X-Received: by 2002:a05:620a:2696:b0:6ff:bd25:df7d with SMTP id
c22-20020a05620a269600b006ffbd25df7dmr51126qkp.513.1670942779013; Tue, 13 Dec
2022 06:46:19 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 13 Dec 2022 06:46:18 -0800 (PST)
In-Reply-To: <1b20f5a8-6319-4bda-abec-240a9ca3e979n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=170.231.44.126; posting-account=xFcAQAoAAAAoWlfpQ6Hz2n-MU9fthxbY
NNTP-Posting-Host: 170.231.44.126
References: <tn9vlg$5ra$1@gioia.aioe.org> <1b20f5a8-6319-4bda-abec-240a9ca3e979n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <69bf93cf-c747-497f-8236-94c848b0a66an@googlegroups.com>
Subject: Re: typedef in old C
From: thiago.a...@gmail.com (Thiago Adams)
Injection-Date: Tue, 13 Dec 2022 14:46:19 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1451
 by: Thiago Adams - Tue, 13 Dec 2022 14:46 UTC

On Tuesday, December 13, 2022 at 11:42:43 AM UTC-3, Thiago Adams wrote:
....
> I think this is one of the biggest problem of C.. but this bothers more implementers.

The data representation of C types are incredible complex.

Also types can have extra parentheses that are useless like:
int (((a)));

Re: typedef in old C

<tna7ai$aer$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=23987&group=comp.lang.c#23987

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!aioe.org!uabYU4OOdxBKlV2hpj27FQ.user.46.165.242.75.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: typedef in old C
Date: Tue, 13 Dec 2022 15:56:02 +0000
Organization: Aioe.org NNTP Server
Message-ID: <tna7ai$aer$1@gioia.aioe.org>
References: <tn9vlg$5ra$1@gioia.aioe.org>
<1b20f5a8-6319-4bda-abec-240a9ca3e979n@googlegroups.com>
<69bf93cf-c747-497f-8236-94c848b0a66an@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="10715"; posting-host="uabYU4OOdxBKlV2hpj27FQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.5.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: Bart - Tue, 13 Dec 2022 15:56 UTC

On 13/12/2022 14:46, Thiago Adams wrote:
> On Tuesday, December 13, 2022 at 11:42:43 AM UTC-3, Thiago Adams wrote:
> ...
>> I think this is one of the biggest problem of C.. but this bothers more implementers.
>
> The data representation of C types are incredible complex.
>
> Also types can have extra parentheses that are useless like:
> int (((a)));

Most languages will allow (((a))) in expressions too; it is not unusual.

What's different with C is treating a type specification as though it
was an expression too, which can be confusing if you come across it
unexpectedly. So:

f(x);

looks like a function call, but could equally be declaring 'x' of type
'f', depending on what 'f' actually is.

Mixing up expression syntax and type syntax was deliberate, but also a
mistake.

Re: typedef in old C

<874jtz2r5s.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=23990&group=comp.lang.c#23990

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: typedef in old C
Date: Tue, 13 Dec 2022 16:40:31 +0000
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <874jtz2r5s.fsf@bsb.me.uk>
References: <tn9vlg$5ra$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="a06bf0c448cd8f60042e094b8aad49ee";
logging-data="2692158"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/6yGh+ycxMAPnAq/XjrMpeRnCpRrZYWao="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:+zlMfjPxptEzUVagrP6ckrgv+Ek=
sha1:GxQHym+ZUXn+YJsSdafwYTsjhr0=
X-BSB-Auth: 1.8f36da4908e41dc2e4d2.20221213164031GMT.874jtz2r5s.fsf@bsb.me.uk
 by: Ben Bacarisse - Tue, 13 Dec 2022 16:40 UTC

Bart <bc@freeuk.com> writes:

> I was looking at the 1983 C sources of PostScript (via
> https://computerhistory.org/blog/postscript-a-digital-printing-press/).
>
> It uses typedef like this:
>
> typedef long int integer;
> typedef unsigned integer Offset;
>
> That is, being able to apply 'unsigned' to a typedef-ed name, rather
> than any of 'char short int long'.
>
> I guess this is not legal C now; I just wondered at what point it
> stopped being legal, if it ever was (perhaps compilers were just more
> lax).

I doubt it has ever been legal. Even K&R1 has the wording that rules it
out. Pre-K&R1 C might have been more lax, but for most of the time
before K&R1 C did not even have unsigned!

I wonder what else this generous compiler permitted. Could one do

typedef double number;
typedef long number hi_prec_num;

for example? I doubt it.

--
Ben.

Re: typedef in old C

<th2mL.27847$iU59.10198@fx14.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=23991&group=comp.lang.c#23991

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx14.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: typedef in old C
Newsgroups: comp.lang.c
References: <tn9vlg$5ra$1@gioia.aioe.org> <874jtz2r5s.fsf@bsb.me.uk>
Lines: 28
Message-ID: <th2mL.27847$iU59.10198@fx14.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 13 Dec 2022 17:05:29 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 13 Dec 2022 17:05:29 GMT
X-Received-Bytes: 1458
 by: Scott Lurndal - Tue, 13 Dec 2022 17:05 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>Bart <bc@freeuk.com> writes:
>
>> I was looking at the 1983 C sources of PostScript (via
>> https://computerhistory.org/blog/postscript-a-digital-printing-press/).
>>
>> It uses typedef like this:
>>
>> typedef long int integer;
>> typedef unsigned integer Offset;
>>
>> That is, being able to apply 'unsigned' to a typedef-ed name, rather
>> than any of 'char short int long'.
>>
>> I guess this is not legal C now; I just wondered at what point it
>> stopped being legal, if it ever was (perhaps compilers were just more
>> lax).
>
>I doubt it has ever been legal. Even K&R1 has the wording that rules it
>out. Pre-K&R1 C might have been more lax, but for most of the time
>before K&R1 C did not even have unsigned!

It probably worked because:

#define unsigned

preceeded it in the translation unit.

Re: typedef in old C

<20221213095812.129@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=23992&group=comp.lang.c#23992

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: typedef in old C
Date: Tue, 13 Dec 2022 18:07:33 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <20221213095812.129@kylheku.com>
References: <tn9vlg$5ra$1@gioia.aioe.org>
<1b20f5a8-6319-4bda-abec-240a9ca3e979n@googlegroups.com>
<69bf93cf-c747-497f-8236-94c848b0a66an@googlegroups.com>
<tna7ai$aer$1@gioia.aioe.org>
Injection-Date: Tue, 13 Dec 2022 18:07:33 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="622be8f5939d11870b20ff15a99210e3";
logging-data="2706977"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+RPMCUXa/LpmEZ6Mud/u71GWyPefPALxI="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:QdM3hS9A2ot3ehn6Tv4lHYdv9iU=
 by: Kaz Kylheku - Tue, 13 Dec 2022 18:07 UTC

On 2022-12-13, Bart <bc@freeuk.com> wrote:
> On 13/12/2022 14:46, Thiago Adams wrote:
>> On Tuesday, December 13, 2022 at 11:42:43 AM UTC-3, Thiago Adams wrote:
>> ...
>>> I think this is one of the biggest problem of C.. but this bothers more implementers.
>>
>> The data representation of C types are incredible complex.
>>
>> Also types can have extra parentheses that are useless like:
>> int (((a)));
>
> Most languages will allow (((a))) in expressions too; it is not unusual.
>
> What's different with C is treating a type specification as though it
> was an expression too, which can be confusing if you come across it
> unexpectedly. So:
>
> f(x);
>
> looks like a function call, but could equally be declaring 'x' of type
> 'f', depending on what 'f' actually is.

Similarly:

(f)(x)

can be casting (x) to type f, or calling f(x).

> Mixing up expression syntax and type syntax was deliberate, but also a
> mistake.

They aren't deep abiguities in the sense that while scanning the f
token, we can resolve it by looking up f, and giving it a token category
like "type-name" versus "identifier". Then the parser just has rules
that involve "type-name".

Still, anyone who just wants an accurate C parser has to implement
declarations, which is annoying.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: typedef in old C

<87bko7tb0o.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=23993&group=comp.lang.c#23993

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: typedef in old C
Date: Tue, 13 Dec 2022 10:27:03 -0800
Organization: None to speak of
Lines: 38
Message-ID: <87bko7tb0o.fsf@nosuchdomain.example.com>
References: <tn9vlg$5ra$1@gioia.aioe.org> <874jtz2r5s.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="3ff48156ba03619b1b817f52b89d4424";
logging-data="2710224"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX192ICtN8mfwPAJ9TEk4EOzs"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:2E3Z/wi8ET64jG1PfzWK/Lr5Ua0=
sha1:GLKZSKRoJkt3AL8pHqLnvhenH0Q=
 by: Keith Thompson - Tue, 13 Dec 2022 18:27 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
> Bart <bc@freeuk.com> writes:
>
>> I was looking at the 1983 C sources of PostScript (via
>> https://computerhistory.org/blog/postscript-a-digital-printing-press/).
>>
>> It uses typedef like this:
>>
>> typedef long int integer;
>> typedef unsigned integer Offset;
>>
>> That is, being able to apply 'unsigned' to a typedef-ed name, rather
>> than any of 'char short int long'.
>>
>> I guess this is not legal C now; I just wondered at what point it
>> stopped being legal, if it ever was (perhaps compilers were just more
>> lax).
>
> I doubt it has ever been legal. Even K&R1 has the wording that rules it
> out. Pre-K&R1 C might have been more lax, but for most of the time
> before K&R1 C did not even have unsigned!

Or typedef.

The 1975 C reference manual has neither typedef nor unsigned (nor long,
nor short). K&R1 (1978) has both. I don't know which was added first.

> I wonder what else this generous compiler permitted. Could one do
>
> typedef double number;
> typedef long number hi_prec_num;
>
> for example? I doubt it.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */

Re: typedef in old C

<877cyvtau9.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=23994&group=comp.lang.c#23994

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: typedef in old C
Date: Tue, 13 Dec 2022 10:30:54 -0800
Organization: None to speak of
Lines: 24
Message-ID: <877cyvtau9.fsf@nosuchdomain.example.com>
References: <tn9vlg$5ra$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="3ff48156ba03619b1b817f52b89d4424";
logging-data="2710224"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mQeWKXCjlBGa+beOxa8qO"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:8j7zopGzmthMfjd3TJnq13ZiO/s=
sha1:kLvmYDZcAQ+FiVgXKmKRoVEs4OY=
 by: Keith Thompson - Tue, 13 Dec 2022 18:30 UTC

Bart <bc@freeuk.com> writes:
> I was looking at the 1983 C sources of PostScript (via
> https://computerhistory.org/blog/postscript-a-digital-printing-press/).
>
> It uses typedef like this:
>
> typedef long int integer;
> typedef unsigned integer Offset;
>
> That is, being able to apply 'unsigned' to a typedef-ed name, rather
> than any of 'char short int long'.
>
> I guess this is not legal C now; I just wondered at what point it
> stopped being legal, if it ever was (perhaps compilers were just more
> lax).

Apparently it was never documented as legal. A compiler that accepted
it presumably had a bug (or perhaps an extension). (1983 was 5 years
after K&R1, which apparently made it clear that it's invalid.)

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */

Re: typedef in old C

<23f8a55a-f280-43ea-bf94-93d4d31c10d4n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=23995&group=comp.lang.c#23995

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:687:b0:6fe:d744:c83f with SMTP id f7-20020a05620a068700b006fed744c83fmr9563427qkh.175.1670958709154;
Tue, 13 Dec 2022 11:11:49 -0800 (PST)
X-Received: by 2002:ac8:46d6:0:b0:3a7:fb76:3000 with SMTP id
h22-20020ac846d6000000b003a7fb763000mr1811151qto.433.1670958708925; Tue, 13
Dec 2022 11:11:48 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 13 Dec 2022 11:11:48 -0800 (PST)
In-Reply-To: <20221213095812.129@kylheku.com>
Injection-Info: google-groups.googlegroups.com; posting-host=170.231.44.126; posting-account=xFcAQAoAAAAoWlfpQ6Hz2n-MU9fthxbY
NNTP-Posting-Host: 170.231.44.126
References: <tn9vlg$5ra$1@gioia.aioe.org> <1b20f5a8-6319-4bda-abec-240a9ca3e979n@googlegroups.com>
<69bf93cf-c747-497f-8236-94c848b0a66an@googlegroups.com> <tna7ai$aer$1@gioia.aioe.org>
<20221213095812.129@kylheku.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <23f8a55a-f280-43ea-bf94-93d4d31c10d4n@googlegroups.com>
Subject: Re: typedef in old C
From: thiago.a...@gmail.com (Thiago Adams)
Injection-Date: Tue, 13 Dec 2022 19:11:49 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2860
 by: Thiago Adams - Tue, 13 Dec 2022 19:11 UTC

On Tuesday, December 13, 2022 at 3:07:46 PM UTC-3, Kaz Kylheku wrote:
> On 2022-12-13, Bart <b...@freeuk.com> wrote:
> > On 13/12/2022 14:46, Thiago Adams wrote:
> >> On Tuesday, December 13, 2022 at 11:42:43 AM UTC-3, Thiago Adams wrote:
> >> ...
> >>> I think this is one of the biggest problem of C.. but this bothers more implementers.
> >>
> >> The data representation of C types are incredible complex.
> >>
> >> Also types can have extra parentheses that are useless like:
> >> int (((a)));
> >
> > Most languages will allow (((a))) in expressions too; it is not unusual.
> >
> > What's different with C is treating a type specification as though it
> > was an expression too, which can be confusing if you come across it
> > unexpectedly. So:
> >
> > f(x);
> >
> > looks like a function call, but could equally be declaring 'x' of type
> > 'f', depending on what 'f' actually is.
> Similarly:
>
> (f)(x)
>
> can be casting (x) to type f, or calling f(x).
> > Mixing up expression syntax and type syntax was deliberate, but also a
> > mistake.
> They aren't deep abiguities in the sense that while scanning the f
> token, we can resolve it by looking up f, and giving it a token category
> like "type-name" versus "identifier". Then the parser just has rules
> that involve "type-name".
>
> Still, anyone who just wants an accurate C parser has to implement
> declarations, which is annoying.

The problem is not only parsing..it is type manipulation.
imagine to calculate the size of sizeof(f)

void (*f[10])(int a[2], void (*pf)(int));

Re: typedef in old C

<90baa9f2-501f-4354-bff1-85824e1c0c60n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24000&group=comp.lang.c#24000

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:995:b0:3a6:8f15:54ff with SMTP id bw21-20020a05622a099500b003a68f1554ffmr30626404qtb.612.1671039765481;
Wed, 14 Dec 2022 09:42:45 -0800 (PST)
X-Received: by 2002:ae9:ed15:0:b0:6fe:daa7:270 with SMTP id
c21-20020ae9ed15000000b006fedaa70270mr8394841qkg.182.1671039765236; Wed, 14
Dec 2022 09:42:45 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 14 Dec 2022 09:42:44 -0800 (PST)
In-Reply-To: <tn9vlg$5ra$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=24.107.184.18; posting-account=G1KGwgkAAAAyw4z0LxHH0fja6wAbo7Cz
NNTP-Posting-Host: 24.107.184.18
References: <tn9vlg$5ra$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <90baa9f2-501f-4354-bff1-85824e1c0c60n@googlegroups.com>
Subject: Re: typedef in old C
From: luser.dr...@gmail.com (luser droog)
Injection-Date: Wed, 14 Dec 2022 17:42:45 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2632
 by: luser droog - Wed, 14 Dec 2022 17:42 UTC

On Tuesday, December 13, 2022 at 7:45:34 AM UTC-6, Bart wrote:
> I was looking at the 1983 C sources of PostScript (via
> https://computerhistory.org/blog/postscript-a-digital-printing-press/).
>
> It uses typedef like this:
>
> typedef long int integer;
> typedef unsigned integer Offset;
>
> That is, being able to apply 'unsigned' to a typedef-ed name, rather
> than any of 'char short int long'.
>
> I guess this is not legal C now; I just wondered at what point it
> stopped being legal, if it ever was (perhaps compilers were just more lax).

Overall it seems to be "cutting edge" C for the time AFAICT.
New types are used all over to convey semantic information
about the variable that also makes the selection of the concrete
type very DRY.

Very surprising to me is the use of linked lists for the basic stacks.
Since the original application in the Apple Laserwriter was very
memory constrained, it's surprising that they spent the size of an
extra pointer on every stack element. Even unused elements have
this pointer, being linked together on their own per stack free list.

OTOH this would make it easy to initialize the stacks to use whatever
odd space was available after making big contiguous memory areas
for other stuff. You just carve up little (next pointer, object} nodes from
the desired memory and link them together into the free list.

So maybe the memory contraints encouraged this choice even though
it appears surprising that the famous "stack based language" does not
in fact use "stacks" per se.

Re: typedef in old C

<87o7s51z3a.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24004&group=comp.lang.c#24004

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: typedef in old C
Date: Wed, 14 Dec 2022 20:59:05 +0000
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <87o7s51z3a.fsf@bsb.me.uk>
References: <tn9vlg$5ra$1@gioia.aioe.org>
<90baa9f2-501f-4354-bff1-85824e1c0c60n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="bff6444afe367a8628935bca259d998b";
logging-data="3024464"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19KT9OcM1kOIxj2Bb/Y9pxLEY+VO8CTZ0A="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:3+M0thrROoIQmcbznFZJrvoahrM=
sha1:rZKaAhdUuO1g2KO6XSZbCHVXgzw=
X-BSB-Auth: 1.6f5836e24759f8ecf40f.20221214205905GMT.87o7s51z3a.fsf@bsb.me.uk
 by: Ben Bacarisse - Wed, 14 Dec 2022 20:59 UTC

luser droog <luser.droog@gmail.com> writes:

> On Tuesday, December 13, 2022 at 7:45:34 AM UTC-6, Bart wrote:
>> I was looking at the 1983 C sources of PostScript (via
>> https://computerhistory.org/blog/postscript-a-digital-printing-press/).
>>
>> It uses typedef like this:
>>
>> typedef long int integer;
>> typedef unsigned integer Offset;
>>
>> That is, being able to apply 'unsigned' to a typedef-ed name, rather
>> than any of 'char short int long'.
>>
>> I guess this is not legal C now; I just wondered at what point it
>> stopped being legal, if it ever was (perhaps compilers were just more lax).
>
> Overall it seems to be "cutting edge" C for the time AFAICT.
> New types are used all over to convey semantic information
> about the variable that also makes the selection of the concrete
> type very DRY.
>
> Very surprising to me is the use of linked lists for the basic stacks.
> Since the original application in the Apple Laserwriter was very
> memory constrained, it's surprising that they spent the size of an
> extra pointer on every stack element. Even unused elements have
> this pointer, being linked together on their own per stack free list.
>
> OTOH this would make it easy to initialize the stacks to use whatever
> odd space was available after making big contiguous memory areas
> for other stuff. You just carve up little (next pointer, object} nodes from
> the desired memory and link them together into the free list.

That's the key. It's simple.

About that time I visited a research lab developing cutting edge
distributed systems. Around the lab the team had pinned a huge banner
bearing the words "MEMORY IS CHEAP". When I asked about this (because
memory was /not/ cheap or plentiful in most systems at the time) I was
told that, because it /will/ be cheap and plentiful, cutting edge
software should not waste time solving a problem that will vanish by
release 2.0 (or in some cases even by the first release).

> So maybe the memory contraints encouraged this choice even though
> it appears surprising that the famous "stack based language" does not
> in fact use "stacks" per se.

What then, to your mind, is a stack?

--
Ben.

Re: typedef in old C

<tndg39$2sbaf$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24005&group=comp.lang.c#24005

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: typedef in old C
Date: Wed, 14 Dec 2022 13:44:09 -0800
Organization: A noiseless patient Spider
Lines: 61
Message-ID: <tndg39$2sbaf$2@dont-email.me>
References: <tn9vlg$5ra$1@gioia.aioe.org>
<90baa9f2-501f-4354-bff1-85824e1c0c60n@googlegroups.com>
<87o7s51z3a.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 14 Dec 2022 21:44:09 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="fd5de455e00ae36edc92cb2830305e5c";
logging-data="3026255"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18eloRZxLkgtuzfoBxKVlI9Crbzmxp594Q="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.5.1
Cancel-Lock: sha1:/ZMq8CE7P7Qs3DjqNegIXzP2fRo=
In-Reply-To: <87o7s51z3a.fsf@bsb.me.uk>
Content-Language: en-US
 by: Chris M. Thomasson - Wed, 14 Dec 2022 21:44 UTC

On 12/14/2022 12:59 PM, Ben Bacarisse wrote:
> luser droog <luser.droog@gmail.com> writes:
>
>> On Tuesday, December 13, 2022 at 7:45:34 AM UTC-6, Bart wrote:
>>> I was looking at the 1983 C sources of PostScript (via
>>> https://computerhistory.org/blog/postscript-a-digital-printing-press/).
>>>
>>> It uses typedef like this:
>>>
>>> typedef long int integer;
>>> typedef unsigned integer Offset;
>>>
>>> That is, being able to apply 'unsigned' to a typedef-ed name, rather
>>> than any of 'char short int long'.
>>>
>>> I guess this is not legal C now; I just wondered at what point it
>>> stopped being legal, if it ever was (perhaps compilers were just more lax).
>>
>> Overall it seems to be "cutting edge" C for the time AFAICT.
>> New types are used all over to convey semantic information
>> about the variable that also makes the selection of the concrete
>> type very DRY.
>>
>> Very surprising to me is the use of linked lists for the basic stacks.
>> Since the original application in the Apple Laserwriter was very
>> memory constrained, it's surprising that they spent the size of an
>> extra pointer on every stack element. Even unused elements have
>> this pointer, being linked together on their own per stack free list.
>>
>> OTOH this would make it easy to initialize the stacks to use whatever
>> odd space was available after making big contiguous memory areas
>> for other stuff. You just carve up little (next pointer, object} nodes from
>> the desired memory and link them together into the free list.
>
> That's the key. It's simple.
>
> About that time I visited a research lab developing cutting edge
> distributed systems. Around the lab the team had pinned a huge banner
> bearing the words "MEMORY IS CHEAP". When I asked about this (because
> memory was /not/ cheap or plentiful in most systems at the time) I was
> told that, because it /will/ be cheap and plentiful, cutting edge
> software should not waste time solving a problem that will vanish by
> release 2.0 (or in some cases even by the first release).
>
>> So maybe the memory contraints encouraged this choice even though
>> it appears surprising that the famous "stack based language" does not
>> in fact use "stacks" per se.
>
> What then, to your mind, is a stack?
>

LIFO. Yes it can be created in thread "local" memory. I did one where
thread local memory was used to simulate a shared memory system. Back on
Quadros, iirc. A region allocator on the threads "stack" can be very
useful...

https://groups.google.com/g/comp.lang.c/c/7oaJFWKVCTw/m/sSWYU9BUS_QJ

https://pastebin.com/raw/f37a23918

Some old experimental code of mine. 2009, how time goes by. wow.

Re: typedef in old C

<877cyt1j0d.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24008&group=comp.lang.c#24008

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: typedef in old C
Date: Thu, 15 Dec 2022 02:46:26 +0000
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <877cyt1j0d.fsf@bsb.me.uk>
References: <tn9vlg$5ra$1@gioia.aioe.org>
<90baa9f2-501f-4354-bff1-85824e1c0c60n@googlegroups.com>
<87o7s51z3a.fsf@bsb.me.uk> <tndg39$2sbaf$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="4e21d85a19619b5cd02452c935caf112";
logging-data="3067628"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+C9SJLgv+eHlMxv/I7GXTkmcNoSn1bhGA="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:cQVnFBtTt+SSrjB6aFp5KI/i8I0=
sha1:DdJMDhPavsPXR2O3/VfrGn2DgT0=
X-BSB-Auth: 1.bcd4ed81b42cba146d8e.20221215024626GMT.877cyt1j0d.fsf@bsb.me.uk
 by: Ben Bacarisse - Thu, 15 Dec 2022 02:46 UTC

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:

> On 12/14/2022 12:59 PM, Ben Bacarisse wrote:
>> luser droog <luser.droog@gmail.com> writes:
>>
>>> On Tuesday, December 13, 2022 at 7:45:34 AM UTC-6, Bart wrote:
>>>> I was looking at the 1983 C sources of PostScript (via
>>>> https://computerhistory.org/blog/postscript-a-digital-printing-press/).
>>>>
>>>> It uses typedef like this:
>>>>
>>>> typedef long int integer;
>>>> typedef unsigned integer Offset;
>>>>
>>>> That is, being able to apply 'unsigned' to a typedef-ed name, rather
>>>> than any of 'char short int long'.
>>>>
>>>> I guess this is not legal C now; I just wondered at what point it
>>>> stopped being legal, if it ever was (perhaps compilers were just more lax).
>>>
>>> Overall it seems to be "cutting edge" C for the time AFAICT.
>>> New types are used all over to convey semantic information
>>> about the variable that also makes the selection of the concrete
>>> type very DRY.
>>>
>>> Very surprising to me is the use of linked lists for the basic stacks.
>>> Since the original application in the Apple Laserwriter was very
>>> memory constrained, it's surprising that they spent the size of an
>>> extra pointer on every stack element. Even unused elements have
>>> this pointer, being linked together on their own per stack free list.
>>>
>>> OTOH this would make it easy to initialize the stacks to use whatever
>>> odd space was available after making big contiguous memory areas
>>> for other stuff. You just carve up little (next pointer, object} nodes from
>>> the desired memory and link them together into the free list.
>>
>> That's the key. It's simple.
>> About that time I visited a research lab developing cutting edge
>> distributed systems. Around the lab the team had pinned a huge banner
>> bearing the words "MEMORY IS CHEAP". When I asked about this (because
>> memory was /not/ cheap or plentiful in most systems at the time) I was
>> told that, because it /will/ be cheap and plentiful, cutting edge
>> software should not waste time solving a problem that will vanish by
>> release 2.0 (or in some cases even by the first release).
>>
>>> So maybe the memory contraints encouraged this choice even though
>>> it appears surprising that the famous "stack based language" does not
>>> in fact use "stacks" per se.
>>
>> What then, to your mind, is a stack?
>
> LIFO.

Sure, but since you didn't dispute that the linked list used by this C
code is a stack "per se", there was really no need to confirm your
position.

--
Ben.

Re: typedef in old C

<VEGmL.8931$5S78.5056@fx48.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24011&group=comp.lang.c#24011

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx48.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: typedef in old C
Newsgroups: comp.lang.c
References: <tn9vlg$5ra$1@gioia.aioe.org> <90baa9f2-501f-4354-bff1-85824e1c0c60n@googlegroups.com> <87o7s51z3a.fsf@bsb.me.uk>
Lines: 48
Message-ID: <VEGmL.8931$5S78.5056@fx48.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 15 Dec 2022 15:01:09 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 15 Dec 2022 15:01:09 GMT
X-Received-Bytes: 2890
 by: Scott Lurndal - Thu, 15 Dec 2022 15:01 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>luser droog <luser.droog@gmail.com> writes:
>
>> On Tuesday, December 13, 2022 at 7:45:34 AM UTC-6, Bart wrote:
>>> I was looking at the 1983 C sources of PostScript (via
>>> https://computerhistory.org/blog/postscript-a-digital-printing-press/).
>>>
>>> It uses typedef like this:
>>>
>>> typedef long int integer;
>>> typedef unsigned integer Offset;
>>>
>>> That is, being able to apply 'unsigned' to a typedef-ed name, rather
>>> than any of 'char short int long'.
>>>
>>> I guess this is not legal C now; I just wondered at what point it
>>> stopped being legal, if it ever was (perhaps compilers were just more lax).
>>
>> Overall it seems to be "cutting edge" C for the time AFAICT.
>> New types are used all over to convey semantic information
>> about the variable that also makes the selection of the concrete
>> type very DRY.
>>
>> Very surprising to me is the use of linked lists for the basic stacks.
>> Since the original application in the Apple Laserwriter was very
>> memory constrained, it's surprising that they spent the size of an
>> extra pointer on every stack element. Even unused elements have
>> this pointer, being linked together on their own per stack free list.
>>
>> OTOH this would make it easy to initialize the stacks to use whatever
>> odd space was available after making big contiguous memory areas
>> for other stuff. You just carve up little (next pointer, object} nodes from
>> the desired memory and link them together into the free list.
>
>That's the key. It's simple.
>
>About that time I visited a research lab developing cutting edge
>distributed systems. Around the lab the team had pinned a huge banner
>bearing the words "MEMORY IS CHEAP". When I asked about this (because
>memory was /not/ cheap or plentiful in most systems at the time) I was
>told that, because it /will/ be cheap and plentiful, cutting edge
>software should not waste time solving a problem that will vanish by
>release 2.0 (or in some cases even by the first release).

Was that lab in San Jose? We used a similar motto extensively when
developing our cutting edge distributed system (1989-1997).

"Memory is not a problem".

Re: typedef in old C

<87len8zjci.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24012&group=comp.lang.c#24012

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: typedef in old C
Date: Thu, 15 Dec 2022 17:07:25 +0000
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <87len8zjci.fsf@bsb.me.uk>
References: <tn9vlg$5ra$1@gioia.aioe.org>
<90baa9f2-501f-4354-bff1-85824e1c0c60n@googlegroups.com>
<87o7s51z3a.fsf@bsb.me.uk> <VEGmL.8931$5S78.5056@fx48.iad>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="4e21d85a19619b5cd02452c935caf112";
logging-data="3297794"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DydMdz8tYF0uyo3pvVZpVc7xGq+NpgNk="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:3rT2Mm97LmJCvqXZZEhJQdfgqPI=
sha1:UV+EsitOo3S3A/JxroH5dwaI9PQ=
X-BSB-Auth: 1.f70aecd47b09221dae0c.20221215170725GMT.87len8zjci.fsf@bsb.me.uk
 by: Ben Bacarisse - Thu, 15 Dec 2022 17:07 UTC

scott@slp53.sl.home (Scott Lurndal) writes:

> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>luser droog <luser.droog@gmail.com> writes:
>>
>>> On Tuesday, December 13, 2022 at 7:45:34 AM UTC-6, Bart wrote:
>>>> I was looking at the 1983 C sources of PostScript (via
>>>> https://computerhistory.org/blog/postscript-a-digital-printing-press/).
>>>>
>>>> It uses typedef like this:
>>>>
>>>> typedef long int integer;
>>>> typedef unsigned integer Offset;
>>>>
>>>> That is, being able to apply 'unsigned' to a typedef-ed name, rather
>>>> than any of 'char short int long'.
>>>>
>>>> I guess this is not legal C now; I just wondered at what point it
>>>> stopped being legal, if it ever was (perhaps compilers were just more lax).
>>>
>>> Overall it seems to be "cutting edge" C for the time AFAICT.
>>> New types are used all over to convey semantic information
>>> about the variable that also makes the selection of the concrete
>>> type very DRY.
>>>
>>> Very surprising to me is the use of linked lists for the basic stacks.
>>> Since the original application in the Apple Laserwriter was very
>>> memory constrained, it's surprising that they spent the size of an
>>> extra pointer on every stack element. Even unused elements have
>>> this pointer, being linked together on their own per stack free list.
>>>
>>> OTOH this would make it easy to initialize the stacks to use whatever
>>> odd space was available after making big contiguous memory areas
>>> for other stuff. You just carve up little (next pointer, object} nodes from
>>> the desired memory and link them together into the free list.
>>
>>That's the key. It's simple.
>>
>>About that time I visited a research lab developing cutting edge
>>distributed systems. Around the lab the team had pinned a huge banner
>>bearing the words "MEMORY IS CHEAP". When I asked about this (because
>>memory was /not/ cheap or plentiful in most systems at the time) I was
>>told that, because it /will/ be cheap and plentiful, cutting edge
>>software should not waste time solving a problem that will vanish by
>>release 2.0 (or in some cases even by the first release).
>
> Was that lab in San Jose? We used a similar motto extensively when
> developing our cutting edge distributed system (1989-1997).
>
> "Memory is not a problem".

No, Pittsburgh :-(

--
Ben.

Re: typedef in old C

<19a20f6c-db32-44d0-9835-fd6edc8da6e2n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24013&group=comp.lang.c#24013

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:489:b0:6fe:c76e:2ad9 with SMTP id 9-20020a05620a048900b006fec76e2ad9mr12344940qkr.35.1671158055017;
Thu, 15 Dec 2022 18:34:15 -0800 (PST)
X-Received: by 2002:ae9:ed15:0:b0:6fe:daa7:270 with SMTP id
c21-20020ae9ed15000000b006fedaa70270mr8649590qkg.182.1671158054804; Thu, 15
Dec 2022 18:34:14 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 15 Dec 2022 18:34:14 -0800 (PST)
In-Reply-To: <87o7s51z3a.fsf@bsb.me.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=24.107.184.18; posting-account=G1KGwgkAAAAyw4z0LxHH0fja6wAbo7Cz
NNTP-Posting-Host: 24.107.184.18
References: <tn9vlg$5ra$1@gioia.aioe.org> <90baa9f2-501f-4354-bff1-85824e1c0c60n@googlegroups.com>
<87o7s51z3a.fsf@bsb.me.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <19a20f6c-db32-44d0-9835-fd6edc8da6e2n@googlegroups.com>
Subject: Re: typedef in old C
From: luser.dr...@gmail.com (luser droog)
Injection-Date: Fri, 16 Dec 2022 02:34:15 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3245
 by: luser droog - Fri, 16 Dec 2022 02:34 UTC

On Wednesday, December 14, 2022 at 2:59:42 PM UTC-6, Ben Bacarisse wrote:
> luser droog <luser...@gmail.com> writes:
>
> > Very surprising to me is the use of linked lists for the basic stacks.
> > Since the original application in the Apple Laserwriter was very
> > memory constrained, it's surprising that they spent the size of an
> > extra pointer on every stack element. Even unused elements have
> > this pointer, being linked together on their own per stack free list.
> >
> > OTOH this would make it easy to initialize the stacks to use whatever
> > odd space was available after making big contiguous memory areas
> > for other stuff. You just carve up little (next pointer, object} nodes from
> > the desired memory and link them together into the free list.
> That's the key. It's simple.
>
> About that time I visited a research lab developing cutting edge
> distributed systems. Around the lab the team had pinned a huge banner
> bearing the words "MEMORY IS CHEAP". When I asked about this (because
> memory was /not/ cheap or plentiful in most systems at the time) I was
> told that, because it /will/ be cheap and plentiful, cutting edge
> software should not waste time solving a problem that will vanish by
> release 2.0 (or in some cases even by the first release).
> > So maybe the memory contraints encouraged this choice even though
> > it appears surprising that the famous "stack based language" does not
> > in fact use "stacks" per se.
> What then, to your mind, is a stack?
>

I'd have expected to see a single TOS pointer ranging over a contiguous
set of addresses. An array representation. I also expected this because
the existing PostScript operators that copy stacks, viz. `execstack`
and `dictstack` both return their data in a (caller supplied) array.

So, the existing interfaces only present array data. And a single
pointer and a packed array are the obvious "minimal space" representation.

Then again, the code we have is from '83, so maybe they were still a few
months away from trying to fit it onto a ROM.

Re: typedef in old C

<875yebz1o0.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24015&group=comp.lang.c#24015

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: typedef in old C
Date: Fri, 16 Dec 2022 17:41:35 +0000
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <875yebz1o0.fsf@bsb.me.uk>
References: <tn9vlg$5ra$1@gioia.aioe.org>
<90baa9f2-501f-4354-bff1-85824e1c0c60n@googlegroups.com>
<87o7s51z3a.fsf@bsb.me.uk>
<19a20f6c-db32-44d0-9835-fd6edc8da6e2n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="23c1fce18d14f8cbf5e73e037834d828";
logging-data="3597729"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+lDp7Jq4jkQhJJbMXjFUtuMDv6q6i5gus="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:T6VSbjNt7ffXpYKk8H/4UQj7IRU=
sha1:Dc/V+5PfLbD+tPqkEFVcBbjmDbk=
X-BSB-Auth: 1.50c4480a9209ff6235cc.20221216174135GMT.875yebz1o0.fsf@bsb.me.uk
 by: Ben Bacarisse - Fri, 16 Dec 2022 17:41 UTC

luser droog <luser.droog@gmail.com> writes:

> On Wednesday, December 14, 2022 at 2:59:42 PM UTC-6, Ben Bacarisse wrote:
>> luser droog <luser...@gmail.com> writes:
>>
>> > Very surprising to me is the use of linked lists for the basic stacks.
>> > Since the original application in the Apple Laserwriter was very
>> > memory constrained, it's surprising that they spent the size of an
>> > extra pointer on every stack element. Even unused elements have
>> > this pointer, being linked together on their own per stack free list.
>> >
>> > OTOH this would make it easy to initialize the stacks to use whatever
>> > odd space was available after making big contiguous memory areas
>> > for other stuff. You just carve up little (next pointer, object} nodes from
>> > the desired memory and link them together into the free list.
>> That's the key. It's simple.
>>
>> About that time I visited a research lab developing cutting edge
>> distributed systems. Around the lab the team had pinned a huge banner
>> bearing the words "MEMORY IS CHEAP". When I asked about this (because
>> memory was /not/ cheap or plentiful in most systems at the time) I was
>> told that, because it /will/ be cheap and plentiful, cutting edge
>> software should not waste time solving a problem that will vanish by
>> release 2.0 (or in some cases even by the first release).
>> > So maybe the memory contraints encouraged this choice even though
>> > it appears surprising that the famous "stack based language" does not
>> > in fact use "stacks" per se.
>> What then, to your mind, is a stack?
>
> I'd have expected to see a single TOS pointer ranging over a contiguous
> set of addresses.

I got that from your earlier remark. I wondered why you thought a
linked list was not a stack "per se".

> An array representation. I also expected this because
> the existing PostScript operators that copy stacks, viz. `execstack`
> and `dictstack` both return their data in a (caller supplied) array.

That might be a big win if the result can be shared, but it's possible
it needs to be copied anyway. I really don't remember.

> So, the existing interfaces only present array data. And a single
> pointer and a packed array are the obvious "minimal space"
> representation.
>
> Then again, the code we have is from '83, so maybe they were still a few
> months away from trying to fit it onto a ROM.

The stack won't be in ROM anyway and the /code/ to manage either kind of
stack will be small.

--
Ben.

Re: typedef in old C

<tnjp2u$3juvv$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24018&group=comp.lang.c#24018

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: typedef in old C
Date: Sat, 17 Dec 2022 07:54:49 +0100
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <tnjp2u$3juvv$1@dont-email.me>
References: <tn9vlg$5ra$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 17 Dec 2022 06:54:22 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="9a8f7bf4fe40593496470a1ad37b67c6";
logging-data="3800063"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18VijkBNR+jjsmrY+BYrI1rcGCZwfuLifs="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.0
Cancel-Lock: sha1:s7rebyEeV5RY2gqioSyeZ09nBek=
Content-Language: de-DE
In-Reply-To: <tn9vlg$5ra$1@gioia.aioe.org>
 by: Bonita Montero - Sat, 17 Dec 2022 06:54 UTC

Am 13.12.2022 um 14:45 schrieb Bart:
> I was looking at the 1983 C sources of PostScript (via
> https://computerhistory.org/blog/postscript-a-digital-printing-press/).
>
> It uses typedef like this:
>
>   typedef long int integer;
>   typedef unsigned integer Offset;
>
> That is, being able to apply 'unsigned' to a typedef-ed name, rather
> than any of 'char short int long'.
>
> I guess this is not legal C now; I just wondered at what point it
> stopped being legal, if it ever was (perhaps compilers were just more lax).

The proper solution is:

#include <type_traits>

using X = unsigned;
using Y = std::make_signed_t<X>;

Maybe they didn't knew that in 1983. ;-)

Re: typedef in old C

<86sfhc18wq.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24042&group=comp.lang.c#24042

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: typedef in old C
Date: Sun, 18 Dec 2022 17:25:57 -0800
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <86sfhc18wq.fsf@linuxsc.com>
References: <tn9vlg$5ra$1@gioia.aioe.org> <874jtz2r5s.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader01.eternal-september.org; posting-host="ff406b04d09b824d6c1109f51ef0323b";
logging-data="102999"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/iabr253NLAyDsJw/oS848rLdNOOKTC58="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:dTCp0JSIn+PGY6RNunPHgk6cUtU=
sha1:nX1o95OHgWux8kNVakpLC+mvlSs=
 by: Tim Rentsch - Mon, 19 Dec 2022 01:25 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> Bart <bc@freeuk.com> writes:
>
>> I was looking at the 1983 C sources of PostScript (via
>> https://computerhistory.org/blog/postscript-a-digital-printing-press/).
>>
>> It uses typedef like this:
>>
>> typedef long int integer;
>> typedef unsigned integer Offset;
>>
>> That is, being able to apply 'unsigned' to a typedef-ed name, rather
>> than any of 'char short int long'.
>>
>> I guess this is not legal C now; I just wondered at what point it
>> stopped being legal, if it ever was (perhaps compilers were just more
>> lax).
>
> I doubt it has ever been legal. Even K&R1 has the wording that rules it
> out. Pre-K&R1 C might have been more lax, but for most of the time
> before K&R1 C did not even have unsigned!
>
> I wonder what else this generous compiler permitted. Could one do
>
> typedef double number;
> typedef long number hi_prec_num;
>
> for example? I doubt it.

Most likely the issue is not the compiler but the code. This
body of code has all sorts of problems, including syntax errors
and some things that are obviously wrong or incomplete. If you
try compiling it I think you'll see what I mean.

Incidentally, there are pretty clear signs of a Mesa influence,
which isn't surprising since the principals came from Xerox PARC.

Re: typedef in old C

<uodnvm$7ord$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31226&group=comp.lang.c#31226

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c
Subject: Re: typedef in old C
Date: Fri, 19 Jan 2024 11:55:34 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <uodnvm$7ord$1@news.xmission.com>
References: <tn9vlg$5ra$1@gioia.aioe.org> <tnjp2u$3juvv$1@dont-email.me>
Injection-Date: Fri, 19 Jan 2024 11:55:34 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="254829"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 19 Jan 2024 11:55 UTC

In article <tnjp2u$3juvv$1@dont-email.me>,
Bonita Montero <Bonita.Montero@gmail.com> wrote:
....
>A stupid solution is:
>
>#include <type_traits>
>
>using X = unsigned;
>using Y = std::make_signed_t<X>;
>
>Maybe they didn't knew that in 1983. ;-)
>

Could you also give us a solution in Basic+?

How about Intercal?

Thanks.

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/LadyChatterley

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor