| Deutsch English Français Italiano |
|
<nnd$74cd4057$3ab3003c@b7bb6e02afaa9baa> View for Bookmarking (what is this?) Look up another Usenet article |
Newsgroups: comp.lang.forth References: <nnd$61e0ad9a$48ed61c2@b4d945e456041481> <66e37b37$1@news.ausics.net> <05fd5a0056972ac60f43598f23a170ad@www.novabbs.com> <66e40a42$1@news.ausics.net> From: albert@spenarnc.xs4all.nl Subject: Re: Avoid treating the stack as an array [Re: "Back & Forth" is back!] X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Originator: albert@cherry.(none) (albert) Message-ID: <nnd$74cd4057$3ab3003c@b7bb6e02afaa9baa> Organization: KPN B.V. Date: Fri, 13 Sep 2024 13:07:32 +0200 Path: ...!weretis.net!feeder9.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feed.abavia.com!abe007.abavia.com!abp003.abavia.com!news.kpn.nl!not-for-mail Lines: 61 Injection-Date: Fri, 13 Sep 2024 13:07:32 +0200 Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com" Bytes: 3460 In article <66e40a42$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote: >On 13/09/2024 5:56 pm, minforth wrote: >> On Thu, 12 Sep 2024 23:37:29 +0000, dxf wrote: >> >>> On 12/09/2024 8:19 pm, Anton Ertl wrote: >>>> Register allocation is one of the most effective optimizations in >>>> compilers. That's also true of Forth. >>>> >>>>> Costs multiply in the face of many small functions. >>>> >>>> Register allocation is also effective for small functions. >>> >>> Moore talked about registers. It's worth repeating for those who may be >>> new >>> to forth. >>> >>> "But such registers raises the question of local variables. There is a >>> lot of >>> discussion about local variables. That is another aspect of your >>> application >>> where you can save 100% of the code. I remain adamant that local >>> variables >>> are not only useless, they are harmful. If you are writing code that >>> needs >>> them you are writing, non-optimal code" - Chuck Moore 1999 >> >> The only thing that can be deduced from this is that back in 1999 >> this was Moore's opinion in the specific context of his work. >> >> Besides, the world has changed a wee bit since then... > >Claims made in respect of locals in forth - ease of use, better performance >through less 'stack juggling', better readability/maintainability - were all >made in the 1980's. What has changed? Forthers today are more willing to >believe, to accept the word of authority, lack the interest to discover the >truth for themselves? If so, that would be a pity. I object to locals because it introduce a superfluous extra concept. It is foreign to a stack oriented language. Also there are numerous conflicting notations, and giving a name to a single cell, isn't sufficient. You need not local doubles, floats and structures. There are people fond of their information hiding aspect, that can easily be done with normal data and an addition like marking some words private. The remaining argument is re-entrancy, an overrated argument. I am also fond of Algol68/go. A different end of the spectrum, but it has a common feature that Forth has: consistency. Local variables break that. I don't take Moore's word for gospel, but I pay attention, because he is an accomplished individual. Groetjes Albert -- Temu exploits Christians: (Disclaimer, only 10 apostles) Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall Art For Home, Office And Garden Decor - Perfect For Windows, Bars, And Gifts For Friends Family And Colleagues.