Mach 2 for Sys 7
Volume Number: 9
Issue Number: 2
Column Tag: Jörg's Folder
Mach2 - System 7 and 32 Bit Compatible
How to patch MACH2 to bring it up to date
By Jörg Langowski, MacTech Magazine Regular Contributing Author
Note: Source code files accompanying article are located on MacTech CD-ROM or
source code disks.
Here’s news for the Macintosh Forth community. As you know, for quite some
time there existed several commercial Forth development systems on the Macintosh,
and over the years you have heard about all of them in this column - MacForth, the
first one and probably the most widely distributed, Mach2 which generated 68000
code, and NEON, the object-oriented implementation. The only one of these three that is
still commercially supported is MacForth, with an active user group and a forum on
CompuServe. Let me start this column with the request to you, the readers, that we
would really like to see examples of what you have done with MacForth and want to
show to others.
MacForth is really the only Forth for the Macintosh that is backed by a
companies’ technical support, and for a major development project, it is the wisest
choice. On the other hand, you know from reading this column that there are public
domain Forth products available on networks etc., and for those of you who just want to
get their feet wet in Forth programming, get used to the programming style etc., some
of them might be quite useful. Here I would mention in particular the two
object-oriented Forths for the Mac: Yerk, the public-domain successor of Neon, and
the Yerk (almost) lookalike Mops with its direct 68000 code generation. Then there is
also Pocket Forth, which is small and fast and e specially suitable for writing desk
accessories for those of you who are still writing them under System 7.
Why all these preliminaries? To get you in the right mood for reading a number
of letters that crossed my (Mac) desktop in the last few months. Mach2, the ‘other’
commercial Forth that you have been reading about here a lot, has lost its commercial
basis. The company that made it, Palo Alto Shipping, is busy with other things now and
does not support it anymore. But it seems that Mach2 may soon join the ranks of Yerk
and others and be supported by users who don’t want to let go of this product, although
it is not clear whether it will be really public domain. One Mach2 developer, Steve
Wiley, has already made some modifications that removed many problems that Mach2
had with System 7; but recently someone else joined him who in his desperation had
actually disassembled a great deal of Mach2’s code and done some of the work that Palo
Alto Shipping should have been doing two years ago. Result: a version of Mach2 that is
System 7 compatible, Apple Event aware and 32 bit compatible. Only virtual memory
does not work yet, but they may get there. Read on.
[Of course, the wisest direction would probably be to change over to MacForth
from Creative Solutions. Their phone number is 800-FORTH-OK. Since Mach2 is not
officially public domain, you may eventually run into licensing issues as well as
technical problems - Ed.]
1. Steve Wiley (excerpts)
Jörg,
Long time, no news. I am glad that MacTutor has been resurrected from the dead.
[(Me too, thanks!] My intentions are to create a totally modern, updated MACH2 for
the current systems. I must agree with you that there should be room for a simple,
quick and easy programming system for the Mac that doesn't require years of work and
study to produce usable results. I would like to keep this philosophy alive with MACH2.
people who like using FORTH won't be forced to use other programming systems to
remain compatible (except for MacForth, of course). Let me know what you think
about this and I will keep you updated on my progress.
- Steve Wiley
2. John Fleming
Dear Jörg:
I have been a user of Mach1 and Mach2 Forth since 1986. And have read your
column in MacTutor nearly as long. Since the creators no longer seem to be supporting
it, and can’t be reached, I have taken the liberty to update it for System 7. I have done
extensive decompilation and patching to make it System 7 compatible, 32-bit clean,
and Apple Event aware. I know it works, since I use it every day on my Mac IIci, in
System 7, 32-bit mode.
I have also rewritten the trap compiler to allow me to update it as new routines
are defined. I have all the System 7 and Communications Toolbox interface routines
installed in my version of Mach2.
I also installed some extras, such as the standard DA and XDEF glue words,
C-style #ifdef conditional compilation, code-optimized record definition and
compilation, and “modules” for the name space so I can load and delete temporary
constant definition files.
I started with Mach2 2.14, since that is the latest version I could get a hold of. I
understand there is a version 2.24, but I couldn't find anyone who had one who could
give me a copy.
Future updates I am considering are:
a) Install an optimizer similar to the one used in MOPS.
b) Make the Editor multi- window
c) Support true code/name loadable modules
To do this first requires decompiling and understanding much of the MACH2 code,
and then figuring out how to patch it.
If you think there might be interest in the Forth community, I could distribute
the update, along with the various source code files that I used during the modification.
Unfortunately, Mach2 is currently not competitive with MOPS, (which I have and
use), so I don't think many will want it. But for the die-hard Mach2 users, some might
appreciate this update.
Separately, do you know any way to get in touch with the PASC folks? (NO!) All
this work I have done would be certainly easier if I could get the source code from
them.
Thanks.
John Fleming flemingj@sat.mot.com
Enthusiastic response from JL. Immediate answer:
3. John Fleming again.
Hi Joerg:
It is going to take me a week to prepare a package. I would like to make sure I
have my documentation in order on how to use my new words, the trap compiler
syntax, and how to use High-Level and Apple Events. I will have to do some form of
cpt/hqx to make sure it reaches you. They don't let us have unlimited access to
Telnet/FTP over Internet here at Motorola, too much proprietary stuff in our
computers. So we have to do it over E-Mail.
I don't mind you announcing this version. I can’t really yet guarantee that every
trap definition is 100% perfect, and so on, because I only reverse-engineered what I
had to, and haven't yet done a proper software quality inspection. I also used the