From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f6b6181765c24743 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-02 11:07:49 PST Path: supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.stanford.edu!arclight.uoregon.edu!newsfeed.ksu.edu!nntp.ksu.edu!news.okstate.edu!dvdeug From: dvdeug@x8b4e53cd.dhcp.okstate.edu (David Starner) Newsgroups: comp.lang.ada Subject: Re: Generics - Difference between ADA and Modula--3 Date: 2 Feb 2001 18:35:57 GMT Organization: Oklahoma State University Message-ID: <95eumd$8i41@news.cis.okstate.edu> References: <3a7646fb$1@rsl2.rslnet.net> <956ols$qtv$1@news.cis.ohio-state.edu> Reply-To: dstarner98@aasaa.ofe.org NNTP-Posting-Host: x8b4e5089.dhcp.okstate.edu User-Agent: slrn/0.9.6.3 (Linux) Xref: supernews.google.com comp.lang.ada:4871 Date: 2001-02-02T18:35:57+00:00 List-Id: On 30 Jan 2001 16:04:12 GMT, Mark Carroll wrote: >In article <3a7646fb$1@rsl2.rslnet.net>, >John Baltomoire wrote: >>Hey, I having trouble figuring out all the differences between modula and >>ada's implemenation of generics.... anyone got any insight or could send me >>in the right direction? > >General comparison between Modula-3 and Ada would be interesting, >actually. (-: Like what? I can give a short overview, but I'm not sure it will be helpful. Modula-3 is designed to be garbage-collected, and provides controls to handle stuff without garbage-collections. Ada is designed so that it is possible to garbage-collect it. It's only garbage-collected on the JVM's, which don't give you any control. If there was another GC implementation, any garbage-collection control would be implementation-specific. Ada designers made perfectly type-safe generics. Modula-3 designers looked at Ada generics and C++ templates and decided the Ada generics were too much of a PITA and went with a C++-style design that catches mistakes at link-time rather than compile-time. Modula-3 enforces information-hiding by putting what would be in Ada's private section into the body, at the cost of doing everything through pointers (implementation detail.) I don't believe Modula-3 has operator overloading. Modula-3 compares types by value instead of by name, and introduces brands to compensate for that. Modula-3 has sets, whereas Ada's designers decided that packed arrays of boolean sufficed. Modula-3 unifies a lot of stuff under expections (like loop-exits and returns) for (IMO) little gain and more confusion. Modula-3 (proper) has a very minimal library, with huge "implementation specific" additions (not a big deal, since every existing implementation derives from the DEC one and shares those additions.) Ada has a decent size library, with moderate additions provided by most implementors that are usually implementation specific in practice as well as theory. Modula-3 tried for a goal of a 50 page standard, and (IMO) ended up cramming a larger language into 50 pages, with the resulting ambigiuties. While the Ada standard is more readable than most, it is more formal and less ambigious than the M3 one. -- David Starner - dstarner98@aasaa.ofe.org Pointless website: http://dvdeug.dhis.org