[comp.lang.modula2] Modula2 for Apollos and Ada,Modula2 question

apollo@ecf.UUCP (09/23/87)

        We are looking at the possibility,in the future, of using
Modula-2.  The development environment will be Apollo workstations.

        I would like to know then if anyone knows of the various  merits
of the different Modula2 compilers for Apollos.

        One question before I go.  Are developers using Modula2 as a
prototyping tool for, if you will, Ada programming?  I guess
the reason why ask this is that there seem to be a number of rather
inexpensive Modula2 compilers available thus making this language more
accessible to more users.  Another thing is, or was, Modula2 intended
for the development of embedded real-time applications, much like Ada is and was?
        
        Feel free to either post to net or e-mail responses to me.


        Thanks in advance.
      
                         Vince Pugliese
                         University of Toronto
                         (416)667 7744
                         e-mail:apollo@ecf.toronto.edu
     
           

thomsen@trwspf.TRW.COM (Mark Thomsen) (09/26/87)

In article <281@mv03.ecf.toronto.edu> apollo@ecf.toronto.edu (Vince Pugliese) writes:
>        One question before I go.  Are developers using Modula2 as a
>prototyping tool for, if you will, Ada programming?  I guess
>the reason why ask this is that there seem to be a number of rather
>inexpensive Modula2 compilers available thus making this language more
>accessible to more users.  Another thing is, or was, Modula2 intended
>for the development of embedded real-time applications, much like Ada is and was?


This is one of the great questions of our era in software engineering - whither
Ada and Modula-2.  I am in an aerospace company (thus Ada is important) and
also in a front-end R&D organization within that company.  We use Modula-2
extensively within our environment because it is cost effective when buying
compilers, when buying development environments, when training people to use
it, when developing multiple-processor operating systems, when developing
algorithms, and when integrating new hardware.  It is not a sub-Ada in any
meaningful sense, though we sometimes call it "Ada Lite" and "Real-Time Ada"
to emphasize that it is the best subset of what is really essential.  We get
pressure to use Ada but no extra money to buy the equipment or spend the extra
effort to develop the software.

It is not that Ada is a bad language per se (we each have an opinion on that).
For us it is a more cost effective language that provides the advantages of Ada
(encapsulation & separate compilation, modern syntax, single processor
concurrency, low-level programming) without the excess features.  A customer of
ours pointed out that if Modula-2 was developed 2 years earlier, Ada probably
would not have been developed.  (The less kind may point out that Modula-2
would become Ada in that case.  Comments?)

Your are dead on with the observation that the two languages are for the same
types of applications.  If the DoD asked me I would say mandate Modula-2 for
those programs that Ada seems suitable -- it appears to really be better for
developing real-time, multiprocessor applications (again, I do not say Ada is
a bad language; its just that Modula-2 is better for almost every software
engineering situation I have come across).

By the way, the languages come from almost exactly the same time, have almost
exactly the same rationale and understanding of the software engineering
problem, and have lots of the same syntax.  The only features of Modula-2 that
are not in Ada in equivalent form are procedure variables, sets, and opaque
types (someone challenge this if you disagree -- I would be very interested
in updating my study of this).  John Oglivie in Provo wrote a Modula-2-to-Ada
translator for his masters thesis.  If you wish to use Modula-2 as a precursor
to Ada, you may want to get in touch with John.

This has been long enough.  Does anyone have comments on the relative merits of
the two languages in a constructive sense?


                                         Mark R. Thomsen

The opinions are the author's own and do not reflect TRW's commitment and
considerable support for the use of a common language for DoD procurements.

bruceb@telesoft.UUCP (Bruce Bergman @spot) (09/27/87)

In article <281@mv03.ecf.toronto.edu>, (Vince Pugliese) writes:
> 
>         One question before I go.  Are developers using Modula2 as a
> prototyping tool for, if you will, Ada programming?  I guess
> the reason why ask this is that there seem to be a number of rather
> inexpensive Modula2 compilers available thus making this language more
> accessible to more users.  Another thing is, or was, Modula2 intended
> for the development of embedded real-time applications, much like Ada is and was?
>       
>                          Vince Pugliese
>                          e-mail:apollo@ecf.toronto.edu

Well, I don't believe that Modula-2 was INTENDED for average embedded real-time
applications, mainly because of it's history.  Whether people use it or not (for
that type of application) is really the question.  And even then, it has some of
the same obstacles as Ada for embedded targets.  Read a history of Modula-2 in
some of the language text books for a feeling of WHY it came into being...

Now, as to the OTHER question:

I am an Ada developer (both at home and work).  I prefer Ada as my development
language over any existing language.  I use it daily to develop high-level
sophisticated systems which often target to embedded systems for contractors
that are VERY picky about quality and speed.

I TRIED to find a usable Ada for my home (personal) use and was unable to find
one at the time (around two years ago).  I turned then to Modula-2 as my
alternative.  I wasn't disappointed, however it wasn't what I wanted either.

I have a large application written entirely in Modula-2, consisting of about
11,000 lines of code (not including the ~5,000 lines of runtime code).  It was
originally written for Logitech's compiler (on the PC), however a new compiler
has arrived on the scene that makes Logitech look like a slug in comparison, so
it's recently been reworked for that compiler (a menial task).

I've toyed with the idea of converting this to Ada (to run on a VAX), however
because of some problems (mainly the windowing package doesn't run on VAXen),
I've not followed up that course of thought.  However my code should be pretty
easy to convert to Ada as I use little tricks which make it easier to port to
Ada should I desire.

These 'tricks' have worked pretty good in other cases.  For instance, I did a
prototype assembler in Modula-2, took the code to work, changed a few lines of
code, and recompiled in our Ada.  It didn't run the FIRST time, however after
only one session of bug fixing, I was able to write the remainder of the code
in Ada and (in turn) refit it to Modula-2 again.

Pretty good for portability, I think.  Of course, there is always going to be
those obscure parts of a program that MAY not convert easily (overloading, fi).
I, however, have been fairly pleased with my ability to share the code at work
and home.

With the advent of some fairly good PC Ada compilers now (Meridian, fi), I
would probably use them instead, however even those 'fairly good PC Ada'
compilers have problems over large applications.  Many of the PC Modula-2
compilers are stable enough to consider writing large applications for, and
have the added advantage of being fairly technologically advanced (which is
NOT always the case for the PC Ada compilers).

bruce bergman
-- 
allegra!\                         TeleSoft, Inc.
gould9!  \      crash!--\         (619) 457-2700 x123
ihnp4!    \              \
           >--sdcsvax!---->--telesoft!bruceb (Bruce Bergman N7HAW)
nosc!     /              /
scgvaxd! /     log-hb!--/         5959 Cornerstone Court West
ucbvax! /                         San Diego, CA.  92121-9891

All expressed opinions belong to "Bill the Cat" or me.  :^)

hal@newton.physics.purdue.edu.UUCP (09/29/87)

In article <440@trwspf.TRW.COM> thomsen@trwspf.UUCP (Mark Thomsen) writes:
>In article <281@mv03.ecf.toronto.edu> apollo@ecf.toronto.edu (Vince Pugliese) writes:
>....
>....  The only features of Modula-2 that
>are not in Ada in equivalent form are procedure variables, sets, and opaque
>types (someone challenge this if you disagree -- I would be very interested
>in updating my study of this)....
>
>                                         Mark R. Thomsen

The Ada terminology for opaque types is "private" types.  Also private types
are not restricted as to structure but can be any programmer defined type.
This requires the complete definition of the type appear in the definition
part of a package but this is for the use of the compiler only; the user
cannot reference any components of the private type.  (This opens a whole
"can of worms" from the software engineering standpoint since changing the
implementation may now require changing the definition part).
The package programmer even has control of whether the default definition
of equality "=" is defined on the type ("restricted private" types).

Regarding the virtues of the two languages:
	I have access to a Modula-2 compiler but no access to an Ada
	compiler.  Any possible theoretical advantage of a language
	I can't USE is rather irrelevant to me.

Hal Chambers