Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!sdd.hp.com!ucsd!ucbvax!MITCH.ENG.SUN.COM!wmb From: wmb@MITCH.ENG.SUN.COM Newsgroups: comp.lang.forth Subject: Metacompiling and C Forth 83 Message-ID: <9012121624.AA00871@ucbvax.Berkeley.EDU> Date: 12 Dec 90 01:20:30 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: wmb%MITCH.ENG.SUN.COM@SCFVM.GSFC.NASA.GOV Organization: The Internet Lines: 28 > How slow would [C Forth 83] be, compared to a FORTH compiler written > for any particular processor? It depends on the machine architecture (i.e. how good it is at running C and Forth), the quality of the C compiler, and the implementation technique used for the native Forth under comparison. Clearly, a machine like an RTX-2000, which is optimized for Forth but which is only a so-so C machine, will give you a different answer than a SPARC, which is a good architecture for C but only so-so for Forth. On SPARC, C Forth 83 runs about 50% slower than my direct-threaded native SPARC Forth (i.e. the time ratio is 3:2), using the Sun optimizing C compiler at high optimization levels. This is probably close to the best case. On 68010, the time ratio is about 2:1, comparing the same things as for SPARC (i.e. C Forth 83 compiled by Sun's optimizing C compiler compared to my direct-threaded native 680x0 Forth). On a PC, it is probably worse, but it depends strongly on the particular C compiler. The speed differences between C Forth 83 compiled under several different PC C compilers are quite noticeable. It also depends strongly on whether it is compiled for 16 bit stacks or 32 bit stacks. For the purpose that was being discussed (metacompiling eForth), I doubt that speed differences of this order of magnitude matter very much. Mitch Bradley, wmb@Eng.Sun.COM