Path: csiph.com!aioe.org!.POSTED!not-for-mail From: Rod Pemberton Newsgroups: comp.lang.forth Subject: Re: EXIT THEN Date: Sat, 11 Feb 2017 07:55:59 -0500 Organization: Aioe.org NNTP Server Lines: 45 Message-ID: <20170211075559.5d4b2fc3@_> References: NNTP-Posting-Host: ZTD62cW/Uw8bymX5ok+0NA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:54789 On Fri, 10 Feb 2017 18:13:43 -0800 (PST) hughaguilar96@gmail.com wrote: > On Friday, February 10, 2017 at 6:43:56 PM UTC-7, HAA wrote: > > Coding style may influence this. For SwiftForth 0= IF NOT IF > > appear 200 times compared to ?EXIT (151) EXIT-THEN (227). > > > > Numbers matter but decisions are made on less. Take ANS words NIP > > and TUCK. SwiftForth: NIP (158) TUCK (56) > > NIP and TUCK are conveniences - additions to the language that don't > > fundamentally change anything. > > ANS-Forth was designed by Forth Inc. that in 1994 was using ITC and > knew essentially nothing about code optimization. > > NIP is the same as: SWAP DROP > TUCK is the same as: SWAP OVER NIP and TUCK are prime examples of why I said your In a non-optimizing compiler, making NIP and TUCK into primitives > (written in assembly-language) causes them to execute about twice as > fast as having two primitives compiled (either SWAP DROP or SWAP OVER > for NIP and TUCK respectively). Why should anyone implement infrequently executed words as primitives? If you're going to implement them as primitives, i.e., you don't care about optimizing your time or investment, you might as well go ahead and implement all Forth words as primitives. Rod Pemberton -- All it takes for humanity to conquer the world's toughest problems is to hope, to believe, to share, and to do, in cooperation.