Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #168562

Re: typedef in old C

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c
Subject Re: typedef in old C
Date 2022-12-16 17:41 +0000
Organization A noiseless patient Spider
Message-ID <875yebz1o0.fsf@bsb.me.uk> (permalink)
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>

Show all headers | View raw


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.

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

typedef in old C Bart <bc@freeuk.com> - 2022-12-13 13:45 +0000
  Re: typedef in old C Thiago Adams <thiago.adams@gmail.com> - 2022-12-13 06:42 -0800
    Re: typedef in old C Thiago Adams <thiago.adams@gmail.com> - 2022-12-13 06:46 -0800
      Re: typedef in old C Bart <bc@freeuk.com> - 2022-12-13 15:56 +0000
        Re: typedef in old C Kaz Kylheku <864-117-4973@kylheku.com> - 2022-12-13 18:07 +0000
          Re: typedef in old C Thiago Adams <thiago.adams@gmail.com> - 2022-12-13 11:11 -0800
  Re: typedef in old C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-13 16:40 +0000
    Re: typedef in old C scott@slp53.sl.home (Scott Lurndal) - 2022-12-13 17:05 +0000
    Re: typedef in old C Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-12-13 10:27 -0800
    Re: typedef in old C Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-18 17:25 -0800
  Re: typedef in old C Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-12-13 10:30 -0800
  Re: typedef in old C luser droog <luser.droog@gmail.com> - 2022-12-14 09:42 -0800
    Re: typedef in old C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-14 20:59 +0000
      Re: typedef in old C "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-12-14 13:44 -0800
        Re: typedef in old C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-15 02:46 +0000
      Re: typedef in old C scott@slp53.sl.home (Scott Lurndal) - 2022-12-15 15:01 +0000
        Re: typedef in old C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-15 17:07 +0000
      Re: typedef in old C luser droog <luser.droog@gmail.com> - 2022-12-15 18:34 -0800
        Re: typedef in old C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-16 17:41 +0000
  Re: typedef in old C Bonita Montero <Bonita.Montero@gmail.com> - 2022-12-17 07:54 +0100

csiph-web