Path: csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: 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: <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 Xref: csiph.com comp.lang.c:168550 luser droog 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.