Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Anonymous Newsgroups: comp.arch Subject: Re: displays for nested functions (was Ada vs C) Date: 19 Dec 2015 17:19:57 GMT Lines: 52 Message-ID: References: <3bf7bfbf-ea95-440b-886c-a54edcd78be3@googlegroups.com> <1821eff2-a122-4458-9a87-cf9db7db672d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net f21hpXeZX+dn0cH4NXWFLwgYJBhuyY0M3yFyf5M8marSEFtqmP Cancel-Lock: sha1:9zh44XY3Tus76UaRtS8CAIB2WIQ= sha1:87OUZKiK+BX9U7EL+Ewqpq5ieFE= User-Agent: NewsTap/5.1.2 (iPad) Xref: csiph.com comp.arch:31997 Ivan Godard wrote: > On 12/18/2015 10:11 PM, Anonymous wrote: >> Ivan Godard wrote: >>> On 12/18/2015 8:29 PM, Niklas Holsti wrote: >>> >>> >>> >>>> But it also depends on how the SW uses the HW. As I understand it, the >>>> most accessible Ada compiler (GNAT) uses a "secondary stack" to hold >>>> such dynamically sized, locally created objects, with a fixed-size >>>> pointer from the main stack to the secondary stack. But the same >>>> referencing problem occurs if the interior subprograms are recursive. >>>> Probably the interior subprogram must be passed a pointer (not visible >>>> in the source code) to the stack frame of the lexically exterior >>>> subprogram. >>> >>> Nesting was also used for thread management in some languages with >>> nested functions; a function could spawn a contained function several >>> times, with the containing function acting as thread manager for them. >>> The greatest useful nesting depth I ever saw in practice was 7, of which >>> one was the OS, one the RTS (things like errno), one the "main" >>> application, two were nested threads, and two were worker subroutines. >>> You called the OS or RTS services like any other down-stack function >>> call, which made for a nice clean design. The display had 32 entries, >>> which was at least 2X overkill. >>> >>> >>> I think the KDF9 had a similar arrangement - Nick, do you know? >> >> That sounds nothing KDF9. See: >> >> http://www.findlayw.plus.com/KDF9 > > Thanks for the citation. Looks like the KDF9 hardware had no display, > but the Whetstone system and WALGOL compiler maintained a display in > software. The reference explicitly cites the KDF9 WALGOL as the source > of the hardware display in the B6500, although I was surprised to read > that it was Ben Dent who put that in; I had though Bob Barton did. One > way or the other, it was already in by the time I arrived in Pasadena. > Incidentally, Ben Dent was the best boss I have ever had, bar none, and > extraordinary for engineering at that time, being black. I got that story directly from Bill McKeeman. He also was impressed by Bill Dent, BTW. The Whetstone people may have taken the idea of a display from Dijkstra. -- Bill Findlay