Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!aioe.org!.POSTED!not-for-mail From: Walter Banks Newsgroups: comp.lang.forth Subject: Re: Metrics on stack usage Date: Wed, 17 Sep 2014 17:03:39 -0400 Organization: Aioe.org NNTP Server Lines: 47 Message-ID: <5419F72B.F5EC2F16@bytecraft.com> References: <541855C0.2558D27D@bytecraft.com> <7xmw9zletd.fsf@ruckus.brouhaha.com> <541891FE.9157C03@bytecraft.com> <2014Sep17.092044@mips.complang.tuwien.ac.at> NNTP-Posting-Host: 3UWArZOAzLnoO3sfAplcDA.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:33404 Anton Ertl wrote: > Walter Banks writes: > > > >The kind of code generation "tricks" when programmers hand code > >applications can be easily made part of the overall code generator. > > I have my doubts about that. In particular, I have yet to see a good > stack allocation scheme across basic blocks. > > Anyway, if your source language is Algol-like, I doubt very much that > the code you produce will look like and behave like hand-written Forth > code. I partly agree with you in the sense that forth has a somewhat unique source style and developer thought process. Past that there is potentially a lot to learn from folks who have structured their code around stack machines. (virtual and real) The reason for asking the question here was not so much to achieve a forth like result but to learn from a different thought process on utilizing an different underlying architecture. I have worked on the ISA of quite a few commercial processors and code generators to support them. Most are not orthogonal ISA's. I am less concerned at this point about implementation than creating a real implementation plan. I have a running test compiler. One thing that compilers are good at is accounting and if there is an advantage to creating a stack allocation scheme across basic blocks I think it could be done. The simple question is "why do it?" This is not a challenge but a real question. You made a comment, "behave like hand-written Forth?" I think that this is more than an off hand comment. What makes hand-written forth special? and why? I am not trying to argue about competing alternatives but the simpler if people are using forth (and it has been around for a long time) they are doing it for a reason and I am trying to understand in a deeper way, why. w..