[comp.lang.modula2] Which Modula2 compiler for Macintosh?

robol@cs.vu.nl (Laan R J) (04/16/91)

I'm thinking of buying a Modula-2 compiler for the Macintosh.
The obvious question: which one should I buy?
( I'm not using MPW, so it should be a standalone compiler.)
I've just read about the Metrowerks compiler in ApdaLog. Is
it any good?

(I know this kind of question is put to this newsgroup regularly.
Maybe someone could mail me a summary of the reactions
he/she got when he/she posted a similar request?)

Thanks,

Rob Laan
robol@cs.vu.nl

drc@Apple.COM (Dennis R. Cohen) (04/17/91)

robol@cs.vu.nl (Laan R J) writes:

>I'm thinking of buying a Modula-2 compiler for the Macintosh.
>The obvious question: which one should I buy?
>( I'm not using MPW, so it should be a standalone compiler.)
>I've just read about the Metrowerks compiler in ApdaLog. Is
>it any good?

If you want a stand-alone compiler, it is your sole choice at the moment.  All
other compilers (at least the commercial/supported ones) have disappeared.  It
is a quite acceptable compiler -- the editor is minimalist, the source debugger
is adequate.  You are limited to creating applications and "vanilla Modula-2"
programs, there is no support for creation of DAs, INITs, cdevs, XCMDs, etc.
Support is good, documentation is good.

There is also a shareware (freeware?) compiler by Tim Myers that is available
via anonymous ftp from the apple.com VAX -- it is called MacLogimoPlus and
can be located in /pub/ArchiveVol2/Modula2-mlp.

You should, however, consider either the MetroWerks MPW edition or the p1
(also MPW-based) if you want to do "real" development.  I'm not certain on
the p1, but you can purchase the MetroWerks product (my personal choice)
with MPW included in the package.

----
Dennis Cohen     Internet    AppleLink     AmericaOnline   CompuServe
Claris Corp.   drc@claris.com  COHEN2       AFC DCohen     71076,1377
----
Disclaimer:  Any opinions expressed above are MINE!

d90-mwd@sm.luth.se (Michael Westlund) (04/18/91)

robol@cs.vu.nl (Laan R J) writes:

>I'm thinking of buying a Modula-2 compiler for the Macintosh.
>The obvious question: which one should I buy?
>( I'm not using MPW, so it should be a standalone compiler.)
>I've just read about the Metrowerks compiler in ApdaLog. Is
>it any good?

>(I know this kind of question is put to this newsgroup regularly.
>Maybe someone could mail me a summary of the reactions
>he/she got when he/she posted a similar request?)

>Thanks,

>Rob Laan
>robol@cs.vu.nl

I'm reposting the summary for those of you who didn't see it the first time.

Here we go:


Thanks to all of you who responded to my question about the p1 and MetroWerks
Modula2-compilers for the Macintosh. Sorry for the delay with this summary.

Here we go:

-------------------------------------------------------------------------------
~From: weems@evax.uta.edu (Bob Weems)

I use the MetroWerks Professional Standalone Edition. Fortunately, I
have been able to avoid using MPW.  It is rock-solid.  The only deficiency
is that processes are not supported.

Bob Weems
U. Texas Arlington
-------------------------------------------------------------------------------
~From: Chuck Lins <Chuck_Lins.SIAC_QMAIL@gateway.qm.apple.com>

I've used the Metrowerks compiler (mostly MPW version) and it's quite nice and
also robust. I've worked a little with the stand-alone version. The compiler
there is very fast, but I prefer MPW's editor and other facilities.
-------------------------------------------------------------------------------
~From: drc%clarisii%claris@ames.arc.nasa.gov (Dennis Cohen)

Both of them are pretty decent.  If you are interested in interfacing with
Apple's MacApp class library, you should get the p1 release; otherwise, my
suggestion is to go with the MetroWerks product.  The MetroWerks product is
authored, maintained, and enhanced by Bob Campbell of Apple Computer and was
published (in an earlier incarnation) by TML Systems before TML got out of 
the language products arena.  The p1 compiler is also quite capable, but I
am a little less sanguine about the level of support from the vendor or the
timeliness of enhancement (support isn't really an issue from the standpoint
of problems, just with keeping up to date with all the new interfaces and so
forth coming out of Cupertino).
-------------------------------------------------------------------------------
~From: torbjorn@nic.forut.no

My advice: Stay away from the p1 compiler. It generates inefficient
code, is has all kinds of restrictions regarding use of pointer
expressions, the interface to the Mac toolbox is not well thought out so
that you have to do a lot of (unsafe) typecasts, it has lots of 16-bit
restrictions (LONGCARD impossible as index to arrays and loops, arrays <
64k), support for calling C routines is clumsy (you have to invert the
parameter sequence in the DEF file, no open arrays), the documentation
is extremely bad, etc etc.

Of course you can use it (I do), it compiles and generates code, but
surely the MetroWerks compiler MUST be better than p1.

Sorry that I have to be so negative about p1, but I think it is fair to
let you know so that you do not end up being trapped like me.
-------------------------------------------------------------------------------
~From: thomas@sm.luth.se

Jag har pr|vat Metrowerks kompilator. Den f}r fullt godk{nt.
p1 vet jag ingenting om.

[TRANSLATION: I've tried the MetroWerks compiler. It's OK. I don't know
anything about p1.]
-------------------------------------------------------------------------------
~From: Michael A Chupa <mchupa@brahms.udel.edu>

Although I can't vouch for the MPW edition of the MetroWerks package, I have
been using the PSE (Professional Standalone) version of the MetroWerks
for the past year and a half. I have been pleased with the implementation
and compilation speeds. MetroWerks just mailed me a free upgrade as well!
The MPW version (which I've been considering) has the added bonus of being
able to create code resources as well (such as XFCNs, INITs, etc.) that the
PSE doesn't handle.  Email any further requests for info; I enjoy receiving
overseas mail!
-------------------------------------------------------------------------------
~From: jeffrey templon <templon@copper.ucs.indiana.edu>

	I have used a free Modula-2 for the Mac, Project Modula's MacLogimo
Plus.  I forget where I found in, somewhere over on your side of the ocean.
Maybe something called nic.funet.fi?  Anyway it is an OK Modula as far
as I can tell, I am just learning.  It is not as nice as THINK's systems,
it's not really integrated or MacLike, nor is it MPW like, it mostly looks
like a straight port of a mainframe program.
-------------------------------------------------------------------------------
~From: news@psg.com (Randy Bush)

MetroWerks is based on the Zuerich one-pass, and is done in Cal and Montreal.
I have no email address for these folk.

p1 is done in Muenchen by a small company that's been Modulating for maybe
eight years or so.  I think theirs is based on the four pass, and has OO
extensions.  You can contact Elmar Henne at applelink.apple.com!GER.XDV0002
-------------------------------------------------------------------------------
~From: Dr Ross L Richardson <rlr@lad.med.utas.edu.au>

OK, here is Lawrence D'Oliveiro's comp.sys.mac.programmer summary of M2 for
the Mac.  [That's me talking about p1]  [Lawrence will probably send this to
you also :-)]

###############################################################################

Path: diemen!ditmela!munnari.oz.au!comp.vuw.ac.nz!virtue!ccc_ldo
~From: ccc_ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
~Newsgroups: comp.lang.modula2,comp.sys.mac.programmer
~Subject: Modula-2 for Mac--summary
Message-ID: <851.2685ff61@waikato.ac.nz>
~Date: 25 Jun 90 00:11:13 GMT
Organization: University of Waikato, Hamilton, New Zealand
~Lines: 145
Xref: diemen comp.lang.modula2:1047 comp.sys.mac.programmer:7252

At last, here's the summary of responses I received to my request for info.
I'd like to say thanks for their help to Leigh Hume <lhume@spam.ua.oz.au>,
Dr Ross L Richardson <rlr@lad.med.utas.edu.au>, Dennis Cohen
<claris!drc@ames.arc.nasa.gov>, Povl H Pedersen <ECO8941@ecostat.aau.dk>,
Robert L Chase <rlc@ra.cs.Virginia.EDU>, Jesper Brondum <MAC1@gemini.ldc.lu.se>,
Jonathan Christopher Elliott <u894825@bruny.cc.utas.edu.au> and Chuck Lins
<lins@Apple.COM>.

Background: TML did indeed have a Modula-2 compiler, which has been
discontinued, probably because the author left TML and is now working
for Apple. It was briefly being distributed with OzTEX, the public-domain
implementation of TEX for the Mac (and it may have been available from
the Sumex archives), but this stopped after a dispute arose over whether
permission had in fact been given to do so. This compiler forms the basis
of the Metrowerks product.

There was another company, SemperSoft, formerly selling a Modula-2
compiler, but they have apparently gone out of business.

Two compilers I have been advised *not* to consider are MacMETH and
MetCom. According to Jon Elliott, they are "unequivocably awful. The
sheer incompetence of their construction simply has to be seen to
be believed." In each case, the toolbox support seems complete, but
the language implementation is not.

The only two serious options currently available are Metrowerks,
and a German product called p1.

The Metrowerks compiler is available in two versions, one running
under MPW and one (the "Professional Standalone Edition") running
in its own custom environment.

The non-MPW version can only be used to create ordinary applications,
not stand-alone code resources, so that rules it out as far as I'm
concerned.

The MPW version includes full SANE support, and its interfaces are
up-to-date with MPW 3.1. It supports symbolic debugging with SADE 1.1.
There are no object-oriented extensions at present, but this is
apparently forthcoming.

You can have both "inline" and "code" procedures--the former are
substituted inline on a call, as in Pascal or C, while the latter
are called normally, but their bodies consist of hand-inserted
machine code. There appears to be a limit of about 20 words in
the size of either of these--enough for the longest inline I've
ever written, at any rate. I can't see that I'd have much use
for code procedures; but then, I believe that no development
environment is complete without an assembler...

The p1 product has object support--following Object Pascal--as one
of its strong points. It will even link with MacApp. Other extensions
include (in Ross Richardson's words) "Structured constants, escapes
including '\LThis has a length byte', interface with Pascal & C, multi-
dimension open array parameters, conditional compilation, foreign code
modules, procedure constants..." Also inline routines with multiple
words of inline code, variables at absolute addresses (handy for
getting at low-memory globals, hee-hee), large sets (up to 65536
elements) and functions returning structured types (but no direct
component selection on the function result--you have to assign it
to a variable first).

The compiler fully supports SANE and is up-to-date with the MPW 3.0
interfaces (3.1 apparently forthcoming). It doesn't support SADE
(also forthcoming), but it does come with its own multi-windowing debugger,
"much like the MacMETH debugger". Apparently very good, except
that it can't single-step. You need to compile with the "-ref"
option, and link with a special debugger version of the runtime
library.

On the minus side, p1 doesn't include coroutine/process support.
Oh well, no big deal. Anyway, it would be fun trying to implement
it yourself...

Also, as far as segmentation goes, the entire contents of a source
file must go into the same segment (this will be improved in future).
The manual is described as "rather sparse", but hey, if you can hack
MPW and love it, you can handle "sparse" programming manuals! (Note:
this is a jibe at people with a particular frame of mind, not at
Apple's documentation, which is excellent.)

Other points: p1 comes with the "Standard Library Draft" MODUS libraries,
which Ross prefers to the ones Wirth uses in "Programming in Modula-2".
You also get a makefile generator and a global cross-referencer. The
compiler can generate assembly language output, as well as 68020/68881
code. Value arguments larger than 4 bytes are normally copied onto the
stack (contrast Pascal), but there is a compiler option to conform to
Pascal behaviour.

Both MPW compilers let you build stand-alone code resources, as well
as ordinary applications.

Neither compiler seems to include interfaces besides the standard
MPW ones (e g the Comms Toolbox). I don't think this is a big problem;
I'd just have to hack up the Pascal interfaces to convert them to
Modula-2--I don't think this is a big job.

Checking for circular imports--it looks like nobody bothers with this.
Anyway, it's difficult trying to do it through a "conventional" linker
like the MPW one. It looks like both compilers handle module initialisation
the same way: every module has a global flag (initially cleared) that
indicates if it's been initialised or not, and each module starts by
unconditionally calling the initialisation code for _every_ module it
imports, while the code does nothing if it has already been called.

Compiler reliability: current production versions of both compilers
seem to be quite reliable, and the companies concerned are good about
sending updates to fix what minor problems there were.

The main point against the p1 compiler would appear to be its cost;
Ross mentioned a price direct from p1 of about DM700, while the APDA
price is US$345. The Metrowerks ad, on the other hand, quotes a price
of US$180, including overseas shipping, for their MPW version. The
Spring 1990 APDAlog only lists their Professional Standalone Edition,
though they may be selling the MPW version by now.

Contacts:

	Elmar Henne
	p1, Gesellschaft fur Informatik mbH
	Hogenbergstr. 20-22
	D-8000 Munich 21
	AppleLink: GER.XDV0002

and

	Metrowerks, Inc
	The Trimex Building, Rte 11
	Mooers, NY 12958, USA
	Ph: +1-514-458-2018
	Fax: +1-514-458-2010

Or see the Metrowerks ad on page 66 of the June issue of MacTutor.
Or page 60 of the May issue, or page 20 of the April issue. You
apparently get technical support direct from Metrowerks' "President
and chief technical person", Greg Galanos. They even have an Internet
mail address: modula2@mips1.uqam.ca.

Lawrence D'Oliveiro                       fone: +64-71-562-889
Computer Services Dept                     fax: +64-71-384-066
University of Waikato            electric mail: ldo@waikato.ac.nz
Hamilton, New Zealand    37^ 47' 29" S, 175^ 19' 16" E, GMT+12:00
"...so she tried to break into the father bear's computer, but it was
too hard. Then she tried to break into the mother bear's computer, but
that was too easy..."

###############################################################################

The p1 compiler is multiple pass, and so does not require FORWARD procedure
declarations.  Proper [Mac] segmentation is not yet available, but Elmar
Henne tells me it is next on his list after ISO standardisation.

I can only add that I still find p1 to be great, especially the support
of MacApp.  If you contact Elmar Henne, please mention that I sent you!
-------------------------------------------------------------------------------

Well, that's it. If you have any more questions, you're welcome to e-mail them
to me.
If anyone of you have any more comments on the summary, I'll be happy to
add them.


	/ Mike

-- 
| Michael Westlund     | c/o Rocklin     | Voice natl.  0920 - 132 91   |
| University of Luleaa | Lingonstigen 77 |       intl. +46 920 132 91   |
| SWEDEN               | S-951 55 Luleaa | Internet: d90-mwd@sm.luth.se |

-- 
| Michael Westlund     | c/o Rocklin     | Voice natl.  0920 - 132 91   |
| University of Luleaa | Lingonstigen 77 |       intl. +46 920 132 91   |
| SWEDEN               | S-951 55 Luleaa | Internet: d90-mwd@sm.luth.se |