Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: Walter Banks Newsgroups: comp.lang.forth Subject: Re: Metrics on stack usage Date: Tue, 16 Sep 2014 15:39:42 -0400 Organization: Aioe.org NNTP Server Lines: 37 Message-ID: <541891FE.9157C03@bytecraft.com> References: <541855C0.2558D27D@bytecraft.com> <7xmw9zletd.fsf@ruckus.brouhaha.com> NNTP-Posting-Host: YoO9jN9ybQgjv0MfopP4oQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Mailer: Mozilla 4.79 [en]C-CCK-MCD NSCPCD479 (Windows NT 5.0; U) X-Accept-Language: en X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:33394 Paul Rubin wrote: > Walter Banks writes: > > I am working on a code generator for a stack processor. > > Who better to ask about real stack requirements than a forth group. > > The question is what is the expected stack requirements for a > > forth implementation? > > Is your processor intended to run Forth programs written in Forth style? > If not, the info you ask may not really be useful. Forth programs tend > to be globally hand optimized to re-use stack slots and keep the stack > traffic smooth. The original source is not forth. The code generator is starting with full application program data flow information and maps the code on the execution engine. The forth experience here is relevant and probably could be used in the code generator. The code generator uses a rule based expert system that can utilize and evaluate several competing strategies and select the one most appropriate for the code generation, "this time" The kind of code generation "tricks" when programmers hand code applications can be easily made part of the overall code generator. (I don't want to get dragged into a hand vs machine code efficiency argument) The stack question comes from a bigger argument about what is an appropriate stack size for a processor. Part of the discussion has been about the nature of code written for a stack machine and how it affects machine resources. w..