Discussion:
differences between Ada and Modula-2
(too old to reply)
Arnauld
2011-04-21 12:07:10 UTC
Permalink
Hi folks,

I wouldn't like to arouse a new flame war between the adepts of each
language. But as a newcomer in that "modular" programming world (my
only skills are C, assembly and perl), I had a quick look at Ada too,
and it seems very similar to Modula-2.

What are the main differences between them ?
Marco van de Voort
2011-04-21 12:51:48 UTC
Permalink
Post by Arnauld
I wouldn't like to arouse a new flame war between the adepts of each
language. But as a newcomer in that "modular" programming world (my
only skills are C, assembly and perl), I had a quick look at Ada too,
and it seems very similar to Modula-2.
What are the main differences between them ?
One has minimalism as base principle, the other seems to have maximalism and
everything AND the kitchen sink as base principle.

In some ways you couldn't find two more different languages :-)
Martin Brown
2011-04-21 15:08:31 UTC
Permalink
This post might be inappropriate. Click to display it.
Marco van de Voort
2011-04-21 17:08:53 UTC
Permalink
Post by Martin Brown
Whilst I don't like some of the syntactic sugar of ISO Modula2 I do
agree with the principle of clearly separating VAL(,) and CAST(,).
Though personally I think that you so often mean VAL(TYPE, var) that the
older shorter syntax of TYPE(var) should have remained.
Try out the free XDS M2/Oberon compiler for an idea of what static data
analysis can do for you in a strongly typed language. Some common coding
mistakes are left as a warning but compile to an immediate trap.
Sure. And while I think ADA overcomplicates the picture by adhering strictly
to certain principles, it is at least a consequent implementation of their
base principles. That always makes it interesting to look up how ADA
implements a certain feature when you are considering doing a new feature
(certainly when there are range checking or lowlevel issues with it)

And of course, the logical answer to my jest is so classic it is biblical:

He ,who is without blame, cast the first stone etc.(*)

(*) to see what I mean, just enumerate the various string types in
Delphi/Free Pascal.
Chris Burrows
2011-04-21 23:05:17 UTC
Permalink
Post by Arnauld
Hi folks,
I wouldn't like to arouse a new flame war between the adepts of each
language. But as a newcomer in that "modular" programming world (my
only skills are C, assembly and perl), I had a quick look at Ada too,
and it seems very similar to Modula-2.
What are the main differences between them ?
A six page article titled "Modula-2 and Ada - A Comparison of Four Features"
by Elizabeth B McAlhany and Mark D. Campbell was published in Vol 3 No 4
edition of the Journal of Pascal, Ada and Modula-2 in July / August 1984. I
haven't been able to find it online but you might be able to access a copy
from a university library.

According to the ModulAware "Modula-2 and Oberon-2 Bibliography" webpage
another article is "Pascal, Ada, and Modula-2 - A system programmer's
comparison." by David Coar. This appeared in Vol. 9, No. 8 of BYTE magazine
(pp. 215..232). This is the special Modula-2 issue of BYTE magazine - there
are currently several copies available on eBay.

Regards,
Chris Burrows

CFB Software
http://www.cfbsoftware.com/modula2
Rugxulo
2011-04-23 23:27:52 UTC
Permalink
Hi,
Keep in mind I'm pretty inexperienced at both (to say the least),
but ...
Post by Arnauld
But as a newcomer in that "modular" programming world (my
only skills are C, assembly and perl), I had a quick look ''
at Ada too, and it seems very similar to Modula-2.
What are the main differences between  them ?
Ada Modula-2
=== ========
case insensitive vs. sensitive
1983/95/05/12 (first ISO OOP) vs. PIM2/3/4 (1980s) and ISO (1996) w/
extensions (1997-8)
single-line comments -- vs. nested (* (* *) *)
tasking vs. coroutines
GNAT (since forever) vs. GM2 (only recently reached 1.0)
procedure, function vs. PROCEDURE
access vs. POINTER TO
; as statement terminator vs. as statement separator
null vs. ;
end if; vs. END;
language spec (Ada's RM, aka ARM) is free vs. proprietary (though
older drafts exist)
exceptions vs. HALT
8#777 vs. 777B
package ... renames vs. FROM ... IMPORT
Ada.Strings.* vs. ARRAY OF CHAR

P.S. I've actually heard it said that Modula-3 (three!) is considered
"Ada light", but Modula-2 certainly can compare in most ways (more or
less). Corrections welcome (since this is horribly rough).
Christoph Schlegel
2011-04-25 09:51:36 UTC
Permalink
Post by Rugxulo
Hi,
Keep in mind I'm pretty inexperienced at both (to say the least),
but ...
Post by Arnauld
But as a newcomer in that "modular" programming world (my
only skills are C, assembly and perl), I had a quick look ''
at Ada too, and it seems very similar to Modula-2.
What are the main differences between them ?
Ada Modula-2
=== ========
case insensitive vs. sensitive
1983/95/05/12 (first ISO OOP) vs. PIM2/3/4 (1980s) and ISO (1996) w/
extensions (1997-8)
single-line comments -- vs. nested (* (* *) *)
tasking vs. coroutines
GNAT (since forever) vs. GM2 (only recently reached 1.0)
procedure, function vs. PROCEDURE
access vs. POINTER TO
; as statement terminator vs. as statement separator
null vs. ;
end if; vs. END;
language spec (Ada's RM, aka ARM) is free vs. proprietary (though
older drafts exist)
exceptions vs. HALT
8#777 vs. 777B
package ... renames vs. FROM ... IMPORT
Ada.Strings.* vs. ARRAY OF CHAR
P.S. I've actually heard it said that Modula-3 (three!) is considered
"Ada light", but Modula-2 certainly can compare in most ways (more or
less). Corrections welcome (since this is horribly rough).
exceptions vs. HALT : Niklaus Wirth introduced a module Exceptions in 1979:

http://groups.google.com/group/comp.lang.modula2/browse_thread/thread/ec4e08172e226e0b#

A standardized way to handle exceptions is also there in ISO Modula-2.

http://www.excelsior-usa.com/doc/xds/isom204.html#342

Loading...