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: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: Detecting low-level words. Date: Mon, 28 Apr 2014 05:58:08 -0400 Organization: Aioe.org NNTP Server Lines: 37 Message-ID: References: <6da29953-683e-4874-988e-eb208a43796a@googlegroups.com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:29932 On Mon, 28 Apr 2014 04:10:19 -0400, Elizabeth D. Rather wrote: > On 4/27/14 7:22 PM, Rod Pemberton wrote: >> The idea is some word, like SEE, which emits high-level definitions in >> terms of the complete sequence of low-level words, not just the >> uppermost, >> high-level definition, like TRACE without execution. That can then be >> analysed for optimization. I would guess that this idea has been around >> for some time and perhaps even been developed by someone. > > The thing is, there are so many ways of factoring and naming these > things, and so many names even for the same things. Since the early > 70's, for example, FORTH, Inc. called some of these "behaviors" > (CREATE), (:), etc., and never found a need for DODOES because of the > way we compiled DOES>. > True. However, that doesn't mean the ability to emit complete low-level sequences wouldn't be useful. Every word in the dictionary could be emitted as a complete low-level sequence rather easily. E.g., with all sequences available, one could potentially detect unoptimized words, or code thrashing, etc. It could also allow partial sequences of low-level words to be optimized by a non-Forth optimizer, e.g., stack sequences. Or, it could allow for rewriting definitions to preference one Forth word over another. It could also be used for static frequency analysis of the low-level words, i.e., which low-level words are being used the most. These would be the words that need more optimization. Those should already be known to the designer, but maybe something unexpected comes out from the analysis, say perhaps that the implementation of the branching is excessively complicated, and likely slow. Rod Pemberton