[comp.sys.mac.programmer] Modula-2 for Mac?

ccc_ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) (06/07/90)

I'm looking for recommendations for a Modula-2 compiler for the Macintosh.
I'd be grateful to anybody who has any suggestions to make. I saw the ad
for the Metrowerks compilers in MacTutor. Has anybody used any of these?
Also, didn't TML use to sell a compiler? Is it still available?

My preference is that the compiler run in the Macintosh Programmer's
Workshop environment. I'm prepared to listen to differing viewpoints,
but I've been an MPW hacker for a year and a half now, and as far as
I'm concerned, MPW is the neatest programming environment on any PC.

Specific questions you might like to consider are:

* What extensions have been made to the language? In particular, are
  inlines supported, a la Pascal? (I have this personal prejudice
  against having to link in lots of assembly-language "glue".)
* Does the language have full SANE support, including single, double
  and extended precision reals?
* Are the Toolbox and OS interface files up to date (as of MPW version 3.1)?
  Are any additional interface definitions available, such as the ones for
  the Communications Toolbox?
* How elaborate is the run-time support? How does the compiler get the
  MPW linker to initialise modules in the right order? Is there checking
  for circular import relationships? (Regardless of how Wirth feels,
  I consider this essential.)
* Is it possible to write stand-alone code resources? (Desk accessories,
  HyperCard externals etc).
* Is there any provision for symbolic debugging? For example, the
  compiler might generate debugging information compatible with SADE
  by pretending to be Pascal.
* Any feeling for the reliability of the compiler? The other two MPW
  compilers I use are TML Pascal II (because I like Pascal) and Apple's
  C compiler (because I have to). With these, I've been finding about
  one compiler problem every 5-10,000 lines of code (at a rough estimate).

These are just suggestions. If you have any other points you think are
worthy of mention, feel free to do so.

If this question has been asked before (as it probably has been), I'd
appreciate a copy of the summary of replies. Otherwise, as usual, mail
me your recommendations, and I'll summarise to both comp.lang.modula2
and comp.sys.mac.programmer.

Lawrence D'Oliveiro
Computer Services Dept                    fone: +64-71-562-889
University of Waikato                      fax: +64-71-384-066
Hamilton, New Zealand            electric mail: ldo@waikato.ac.nz
9. Laugh at whatever they write.  A good "HAHAHAHAHAHAHAHAHAHAHAHAHAHA"
   should intimidate just about anyone.
			       (from the USENET Guide to Power Posting)

lins@Apple.COM (Chuck Lins) (06/08/90)

In article <671.266ea0ae@waikato.ac.nz> ccc_ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
>I'm looking for recommendations for a Modula-2 compiler for the Macintosh.
>I'd be grateful to anybody who has any suggestions to make. I saw the ad
>for the Metrowerks compilers in MacTutor. Has anybody used any of these?
	Yes, I've been using what is now the Metrowerks MPW Modula-2, for some
	time. It is quite stable. Fast. Generates good code.

>Also, didn't TML use to sell a compiler? Is it still available?
	Used to. Not anymore.
>
>My preference is that the compiler run in the Macintosh Programmer's
>Workshop environment. I'm prepared to listen to differing viewpoints,
>but I've been an MPW hacker for a year and a half now, and as far as
>I'm concerned, MPW is the neatest programming environment on any PC.
>
>Specific questions you might like to consider are:
>
>* What extensions have been made to the language? In particular, are
>  inlines supported, a la Pascal? (I have this personal prejudice
>  against having to link in lots of assembly-language "glue".)
	Yes, short inlines are supported as well as code procedures.
>* Does the language have full SANE support, including single, double
>  and extended precision reals?
	Yes.
>* Are the Toolbox and OS interface files up to date (as of MPW version 3.1)?
	Yes.
>  Are any additional interface definitions available, such as the ones for
>  the Communications Toolbox?
	Don't think the CommToolbox is covered but I could be wrong.
>* How elaborate is the run-time support? How does the compiler get the
>  MPW linker to initialise modules in the right order? Is there checking
>  for circular import relationships? (Regardless of how Wirth feels,
>  I consider this essential.)
	I don't understand what you mean by run-time support.
	There's special code to call the module initialization code of each
	imported module. Each module has a global variable (flag) hidden from
	the programmer which is initialized to zero. The module initialization
	code sets this flag to -1. So, if it's already been set there's no need
	to initialize the module again.
	No there is no specific checking for circular imports in the compiler.
	Personally, I feel you should (in fact must) avoid dependencies
	between the module initialization code of two circularly dependent
	modules.
>* Is it possible to write stand-alone code resources? (Desk accessories,
>  HyperCard externals etc).
	Yes.
>* Is there any provision for symbolic debugging? For example, the
>  compiler might generate debugging information compatible with SADE
>  by pretending to be Pascal.
	Yes. But remember that SADE has no idea what an opawue type is. All
	you get to see (except in the implementation module where the type is
	defined) is an address. Personally, I wouldn't waste my time on SADE.
>* Any feeling for the reliability of the compiler? The other two MPW
>  compilers I use are TML Pascal II (because I like Pascal) and Apple's
>  C compiler (because I have to). With these, I've been finding about
>  one compiler problem every 5-10,000 lines of code (at a rough estimate).
	The compiler has been very stable. I was using alpha and beta versions
	for a long time and found few problems (which were fixed promptly by
	the author).
>
>These are just suggestions. If you have any other points you think are
>worthy of mention, feel free to do so.
	The only other option for an MPW Modula-2 is the p1 Modula-2 compiler
	from Germany. This compiler has many extensions (based on the proposed
	ISO standard). It's also real expensive. I have not used this compiler
	because of its price. Its advantage over the Metrowerks compiler at
	present is that it works with MacApp(R). I understand the Metrowerks
	is planning object-oriented support (esp. for MacApp) in the future.
>
>If this question has been asked before (as it probably has been), I'd
>appreciate a copy of the summary of replies. Otherwise, as usual, mail
>me your recommendations, and I'll summarise to both comp.lang.modula2
>and comp.sys.mac.programmer.
>
>Lawrence D'Oliveiro
>Computer Services Dept                    fone: +64-71-562-889
>University of Waikato                      fax: +64-71-384-066
>Hamilton, New Zealand            electric mail: ldo@waikato.ac.nz
>9. Laugh at whatever they write.  A good "HAHAHAHAHAHAHAHAHAHAHAHAHAHA"
>   should intimidate just about anyone.
>			       (from the USENET Guide to Power Posting)


-- 
Chuck Lins               | "Is this the kind of work you'd like to do?"
Apple Computer, Inc.     | -- Front 242
20525 Mariani Avenue     | Internet:  lins@apple.com
Mail Stop 37-BD          | AppleLink: LINS@applelink.apple.com
Cupertino, CA 95014      | "Self-proclaimed Object Oberon Evangelist"
The intersection of Apple's ideas and my ideas yields the empty set.