metacompiler project 
Author Message
 metacompiler project

Although most people are by now probably getting sick of it, I want to
give a (hopefully final) status update on the latest mxForth

Just as Leo Wong's fascination with LF/MF/HF, I just can't let go of

We're skipping release 2.3 and go to 2.4 immediately. In 2.3 I added
more macro words and made sure John Hayes's TESTER.FRT ran without
errors. In 2.4 I succeeded in having mxForth run Anton Ertl's
POSTPONE.FS. This is quite an achievement for an optimizing Forth (I
think). I have now a somewhat generalized approach to defining
optimizing macro words that doesn't need state smartness. The macro's
even succeed in generating optimized code when POSTPONEd or
[COMPILE]d. There are *no* state-smart words in mxForth anymore, none.
I will let this technique ripen some more before I backmerge it into
iForth. I don't see yet how I can re-use the macro's in the
metacompiler to make sure the code for mxForth itself is optimized,
but it must be in there somewhere.

Maybe interesting for some people: I've ported mxForth to Windows NT
4.0. It might even work for Windows '95 as long as SYSTEM is not used
(I did not test this!). To be able to testdrive mxForth under Windows
I have made a simple C server available (mxserver.exe) for download at
C server by simply renaming the image file from mxforth.img to
iforth.img. The documentation on my homepage has been expanded to
reflect the latest changes.

Of course mxForth still has the facility to extend it through the C
server. Just write a C function, put its address in the jump table,
and mxForth can call it with SYSCALL. (This might be fun for fooling
around with Windows DLL's interactively).

Although I did my best, I seem to have reached the limit of what
can be done with the mxForth model (subroutine, TOS in register,
datastack indexed by ebp, Forth return == hardware machine stack). In
the end iForth seems to be at least 1.25 times faster than mxForth
(iForth uses the hardware stack for the Forth data stack). I looked
into CF32 by Tom Zimmer - Thom Almy. The programs I could get to run
reliably on CF32 are 1.25 to 2 times faster than mxForth/iForth. The
extra speed comes from the IN/OUT compiler hint CF32 allows the
programmer to give to the compiler.

And now, the results for the standard benchmarks in the Gforth
distribution as run on mxForth 2.4 for NT (The Linux timings are
exactly the same).

Note: The results for Gforth are shown as a base-line figure. This is
 *not* to imply Gforth or mxForth are the Alpha and Omega of Forthing
 and all other Forths are not worthy of your attention. Gforth's
 authors have expressed an interest in building an efficient Forth
 kernel and that's about all mxForth is good for at the moment. For
 building eye-popping, jaw-flapping applications under
 Win32s/Win95/WinNT use Win32Forth, for Linux use ... weell, who wants
 that stuff anyway :-)

For all the following timings I used an Intel Pentium 166MHz with 256K

 siev   bubble  matrix  fib     configuration (times in seconds)
 8.72    9.17    8.79   10.34   gcc-2.7.2 +force-reg; gforth-0.3.0;
 3.26    4.24    2.72    2.99   mxForth 2.2 with OPTIMIZE=15
 2.61    2.13    2.29    1.75   mxForth 2.4 with OPTIMIZE=6 (max)

There is quite a lot of improvement of 2.4 over 2.2, OTOH 2.4 was
very difficult to get right.

-- Program output (NT 4.0) ----------------------------------------
[1] mxForth server 0.69 (console), Jul 30 1997, 16:49:11.
[2] Stuffed mxForth at 0041618A [entry: 0x420000]
[3] Current process priority is 32.
mxForth vsn 2.4

FORTH> cd mxf2/work c:\dfwforth\examples\mxf2\work ok
FORTH> include benches.frt
Running the Ertl Suite...
Sieving...2607 ms elapsed
 redefining list
Bubbling...2129 ms elapsed
Bubbling with flag...2454 ms elapsed
Matrix multiply in progress..2286 ms elapsed
Fibonacci (optimized)...9227465  1690 ms elapsed
Fibonacci (original)...9227465  1746 ms elapsed ok


Sun, 16 Jan 2000 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. metacompiler project

2. Nautilus metacompiler

3. MetaCompilers

4. LMI Metacompiler 3.1 update -- registered users only

5. Help for Forth metacompiler

6. Forth Metacompiler

7. Nautilus metacompiler

8. nautilus metacompiler

9. Metacompiler Forth86/Forth51

10. Advantages of a metacompiler

11. metacompilers and abstract nonsense

12. fun project/ help me verify my graphics project!


Powered by phpBB® Forum Software