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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,3d3f20d31be1c33a X-Google-Attributes: gid1014db,public X-Google-Thread: 1108a1,2c6139ce13be9980 X-Google-Attributes: gid1108a1,public X-Google-Thread: 109fba,2c6139ce13be9980 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,3d3f20d31be1c33a X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,2c6139ce13be9980 X-Google-Attributes: gidf43e6,public X-Google-Thread: fac41,2c6139ce13be9980 X-Google-Attributes: gidfac41,public From: abo@minkirri.apana.org.au (Donovan Baarda) Subject: Re: Is ADA as good for graphics programming as C? (WAS: Re: Avoiding the second historic mistake) Date: 1997/07/03 Message-ID: #1/1 X-Deja-AN: 254342684 References: <33957A33.1C31AB44@oma.com> <865898351snz@nezumi.demon.co.uk> <339ED54C.215A5F85@oma.com> <5noc8u$a8m$3@miranda.gmrc.gecm.com> <33A032AC.2D8BA85C@oma.com> <5nrn86$cvo$3@miranda.gmrc.gecm.com> <33A1CBBB.B0602EC@oma.com> <5o2uls$ku3$2@miranda.gmrc.gecm.com> <33A6ADDA.2099EEB9@oma.com> <33A7D2DE.545B@polaroid.com> <33A9338D.10BB@polaroid.com> <33B09D64.E7F99DA3@saguarosoft.com> <33B16CBB.417A@gdesystems.com> X-Server-Date: 3 Jul 1997 12:02:40 GMT Organization: Minkirri Internet Access Newsgroups: comp.object,comp.software-eng,comp.lang.ada,comp.lang.eiffel,comp.lang.c,comp.lang.c++ Date: 1997-07-03T12:02:40+00:00 List-Id: On Wed, 02 Jul 1997 21:42:31 -0800, Matthew Heaney wrote: >In article <33B16CBB.417A@gdesystems.com>, Michael Levasseur > wrote: > > >>My choices on the three would be: >> >>Graphical Engine Code written in C for maintainability and speed. >> [snip] >I'm curious: on what basis would you consider C superior to Ada for >"maintainability and speed"? What about Ada do you think is responsible >for its being not as fast as C? Have you benchmarked some code in order to >make a comparison? > >It is my understanding that because of Cs aggressive use of type-casting, >optimizations are actually more difficult to make than in Ada, where more >semantic information is given to the compiler (because of the richness of >its type system), thus allowing better optimization than is possible for C. > True. It is not just C's loose typing that makes it hard to optimize. However, Ada is not such an easy language to optimize either. [snip] >That C is more maintainable than Ada: again, on what basis? Better >maintainability would imply that one can more easily understand the code, >by being able to focus on a small part at a time. This a made possible by >Ada (and other languages) by providing a facility to create >programmer-defined abstractions, a facility largely missing in C (when >compared to other langauges). > I would probably agree that Ada is slightly more readable than C, and definitly more mantainable. Readability and mantainability are IMHO not the same thing. Readability is how easy it is to understand a program from the source code. Mantainability is how easy it is to safely modify and update a program during its life time. >So I'm confused by the argument that C is "faster" and "more maintainable" >than Ada. Perhaps you would care to eludicate your reasons for believing >so. Do you have a (small) code example in C that demonstrates why you feel >C is superior to Ada for writing a graphical engine? Perhaps we could then >come up with an equivalent Ada example to show that Ada is not any less >efficient or less maintainable. We might even be able to show that the Ada >example is faster, and more >maintainable. > One of the things that can make Ada pretty inefficient is its pass by copy mechanism. This means that 'in out' parameters have to be copied twice, once on calling the procedure, and once again on return. I believe that it can add extra overheads even for 'in' and 'out' parameters. For large array parameters, this can be a killer. The biggest problem with Ada compared to C, is the language is so complex. The compiler writers have such a hard time just getting it to work that they hardly get around to putting in optimisation. C is so small that compiling it is easy, so more effort gets spent on optimization. I find it hard to believe that there are people who advocate Ada purely on language merits. As a language, Ada sucks. It is probably better for large projects than C, but then C is only a small step above assembler. In just about any application you can think of, there are languages better than Ada for the task. Where Ada wins is in a combination of language merits, available compilers, supporting tools, and market penetration and demand (DOD). Mainly $$$ for programmers :-) ABO