Path: utzoo!utgpu!watserv1!watmath!att!occrsh!uokmax!apple!usc!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!dsl.pitt.edu!pitt!willett!dwp From: dwp@willett.pgh.pa.us (Doug Philips) Newsgroups: comp.lang.forth Subject: Re: Forth optimization (was Re: Postfixer Forth) Message-ID: <1707.UUL1.3#5129@willett.pgh.pa.us> Date: 12 Sep 90 03:19:00 GMT References: <1990Sep7.231911.20882@idacom.uucp> Organization: String, Scotch tape, and Paperclips. (in Pgh, PA) Lines: 45 In <1990Sep7.231911.20882@idacom.uucp>, Andrew Scott writes: > Currently, my optimizer makes the following translation: > > Forth sequences --> native code instructions > > The idea was to create a multi-stage optimizer/translator: > > Forth word --> sequence of virtual primitives > virtual primitive reduction (peephole optimization) > sequence of virtual primitives --> native code instructions > > > This idea looks attractive for creating native code target compilers for > several CPUs. The tough part would be in coming up with the set of atomic > primitives that could be combined into appropriate instructions for a wide > variety of CPU instruction sets. The target compiler engine could be the > same for many CPUs; only the translation rules would differ. So to paraphrase, you target compile into a "high-level-assembly" and then from their have machine dependant optimizing-assemblers? I wonder if eForth would be worth a look? Assuming that it is a renamed version of pigForth, see pages 19-22, "More on Forth Engines," Volume 12, from which I quote without permission: Here is a list of important features we should strife (sic) to include in this Universal pigForth model: High level word set, built on the kernel words. The high level definitions must be portable to all target CPU's, including 8, 16 and 32 bit machines. To enforce portability, words are tokenized to a single set of tokens. The high level word set will be portable as a binary image to all CPU's. Tokenizing the Forth system also makes it easy to optimize an implementation after it is ported. It seems to me like there are some goals in common. (The eForth.ZIP version doesn't contain the implementation manual.) -Doug --- Preferred: dwp@willett.pgh.pa.us Daily: {uunet,nfsun}!willett!dwp