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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 5b1e799cdb,3ef3e78eacf6f938 X-Google-Attributes: gid5b1e799cdb,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!h18g2000yqj.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.modula3,comp.programming Subject: Re: Alternatives to C: ObjectPascal, Eiffel, Ada or Modula-3? Date: Sat, 18 Jul 2009 08:50:38 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 88.170.86.208 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1247932239 5170 127.0.0.1 (18 Jul 2009 15:50:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 18 Jul 2009 15:50:39 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h18g2000yqj.googlegroups.com; posting-host=88.170.86.208; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009061208 Iceweasel/3.0.9 (Debian-3.0.9-1),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.eiffel:299 comp.lang.ada:7133 comp.lang.modula3:26 comp.programming:11757 Date: 2009-07-18T08:50:38-07:00 List-Id: Andrea Taverna wrote: [...] > So I have considered these alternatives: FreePascal, Eiffel, Ada and > Modula-3. > I have taken a look at all of them and I'm still undecided. Below are > the impressions I got for each language. > Can you help me? Feel free to recommend other languages as well. [...] > =A0 =A0 =A0- Ada is best suited for large teams and/or critical software,= thus > it may be overkill for my work, OTH it could have anything I might > happen to need. I don't think it is overkill; Ada is not only an engineer's dream but also an engineering student's dream because of its clear separation of concerns (e.g. between inheritance (derived types) and encapsulation (packages). > What holds me from jumping onto Ada is the potential complexity You don't have to learn all of the language all at once; you can start with Ada as a "Pascal done right" (i.e. with separate compilation built in and the "dangling else" problem fixed). You can learn the OO and generic features later, as you need them. > It would be interesting =A0to hear the experience of other people learnin= g > Ada from the C/Java background. > As for memory management (requirement 4), I heard there are different > takes on the matter: > =A0(a) Ada uses dynamic stack allocation a lot, and in a transparent way, > reducing the need of manual management (MM) > =A0(b) Ada libraries adopt idioms that further simplifies MM issues > =A0(c) Conservative garbage collectors such as Bohem's can be used with > Ada, and they are supposed to work "better" with Ada than with unsafe > languages such as C and C++ I have to add: (d) controlled types allow you to control allocation and deallocation without a garbage collector. > So can MM be said to be easier in Ada than in C? I hope Ada-ers will > mercifully shed some light on the issue. Yes, MM is definitely easier in Ada than in C; my experience with Java's garbage collector is that (a) you never learn to manage memory, and (b) is is very easy to run out of memory and get the infamous OutOfMemoryError. That has never happened to me in Ada, simply because Ada forces me to think about this problem. Another reason why Ada is easier than C is because you use pointers only for what they were designed: dynamic allocation and deallocation. As a consequence, each time you introduce a pointer you naturally think about memory management. Contrast this to C where simple parameter passing often requires pointers, and with Eiffel or Java where everything is a pointer whether you like it or not. > There seems to be a lot of Ada95 free documentation on the net, I guess > it's suitable for Ada05 as well. Yes indeed, thanks to backward compatibility. Also there are now several textbooks on Ada 2005, inclusing the free Wikibook "Ada programming". Finally, since strong static typing is one of your criteria, Ada has the strongest and most powerful typing system I've ever seen in any language, and it also has "escape hatches" to allow you to circumvent it in extreme situations like interfacing directly to hardware. This typing system comes complete with compile-time and run-time checks which you can selectively disable at the few places where performance is critical. I would perhaps add another criterion to your list: ease of installation of the compiler and associated tools on your preferred platform. In one extreme, you have to bootstrap the compiler yourself and then build all libraries from source; at the other end of the spectrum, there are complete binary distributions ready to use. -- Ludovic Brenta.