From: jhh@cwi.nl (Jaap Henk Hoepman)
Newsgroups: comp.sys.atari.st.tech
Subject: Re: MODPAS
Date: 21 Jan 93 10:21:01 GMT
Organization: CWI, Amsterdam

For your information,

I was rather pleased to hear that even someone not living in the Netherlands had
heard of ModPas. It is a dialect resembling Pascal, but may be closer to Modula-2
(I don't really know Module-2, so...). It is a language based on seperately
compilable modules, that can access things declared in other modules if they
are in that objects interface. It has been developed at the Twente University
of Technology and the University of Groningen, both in the Netherlands.

I have used this language almost exclusively for my own programming tasks, for it
allows VERY structured programming. Besides that, the compiler has been ported to
different platforms (I know there are DOS-versions, and SUN-Unix versions too).
The compiler itself compiles to intermediate abstract code first. They also 
developed a code-generator-generator that will generate the code-generator for
a specific hardware platform, giving a machine description of the hardware. 
This code-generator tries to do a lot of optimizing.

Because of the code-generator-generator, porting is really easy (I did a port
from a SUN version to a HP-UX version in less than two weeks, without prior
knowledge of the internal workings of the compiler). It's a clean program.

Now for the bad part: the last version I obtained was 1.0, some three years ago.
I registered as a user, and was supposed to hear of any new releases or other
news, but no, nothing happened. I suppose there is no new version. I believe
the program is PD, but I'd better check this at home. 

To warn you in advance, the compiler is VERY slow (it's a FIVE pass compiler).
Also the actual code generated is not that fast either, because for some reason
they have implemented a kind of shared module principle. This gives very small
executables if you use a lot of standard modules that are already linked in the
ModPas environment Shell (from which they then have to be called), but also
incurs a huge overhead in calling functions from another module:
	- first the base address of the module has to be fetched
	- this module starts with a jumptable to all functions declared in it
	- calling a function just does a jsr to the associated entry in the
	  jumptable
	- from the jumptable you jump to the code of the function
This seems to be unavoidable if you want to use shared modules, and do not
want to resort to code modification (after one call to an external function, the
actual code-address is substituted). But the optimizing code-generator somehow
is able to balance the odds in most cases.

Also, there is not really much support for calling Atari-specific operating 
system functions. There are some modules that interface to the O.S., but they
are incomplete. I have a few modules interfacing to the AES/VDI, but they are
not really stable (not part of the 'official' release, you know).

If you're interested, I may be able to supply you with a copy (if it's PD of
course). I tried Archie to locate it, but it doesn't seem to be on any archive.

-- 


            "  \/
             \_ \
             / \/ /
             \ / /       
_____________   /
             |HHH
_____________|HHH


===============================================================================
Jaap-Henk Hoepman	"Yes, we've eaten up the silver when even food was
jhh@cwi.nl                      against us"		Nick Cave
Newsgroups: comp.sys.atari.st.tech