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.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 107f24,582dff0b3f065a52 X-Google-Attributes: gid107f24,public X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,582dff0b3f065a52 X-Google-Attributes: gid1014db,public X-Google-Thread: 109fba,582dff0b3f065a52 X-Google-Attributes: gid109fba,public X-Google-ArrivalTime: 2001-08-06 07:13:21 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!feed.textport.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.functional From: Ted Dennison References: <9k9if8$rn3$1@elf.eng.bsdi.com> <3B687EDF.9359F3FC@mediaone.net> <5267be60.0108021911.7d8fe4@posting.google.com> <3B6B637F.E3FA243E@worldnet.att.net> Subject: Re: How Ada could have prevented the Red Code distributed denial of service attack. Message-ID: X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Mon, 06 Aug 2001 10:13:11 EDT Organization: http://www.newsranger.com Date: Mon, 06 Aug 2001 14:13:11 GMT Xref: archiver1.google.com comp.lang.ada:11353 comp.lang.c:72444 comp.lang.c++:80292 comp.lang.functional:7333 Date: 2001-08-06T14:13:11+00:00 List-Id: In article , Larry Kilgallen says... >If you aspire to compare the speed of two languages, you must do so Then you aspire to make a meaningless comparison. >for equivalent programs. That means, at the gross level: > > Compare a default Ada program to a C program that has > hand-coded checks everywhere Ada inserts checks. > > or: > Compare a default C program to an Ada program which has > checks suppressed. The speed you are going to see out of this result is going to have way more to do with the compiler writers than it does the language. For instance, if I took your same C algorithm, recoded it in Ada, then compiled the C using VC++ and the Ada using my GreenHills compiler, which is meant for embedded PC targets and has oodles of optimization options, then there's a very good chance the Ada will end up faster. On the other hand, if I use the ObjectAda Win32 compiler for the Ada code, and GreenHills' embedded C compiler, there's a good chance the C would run faster. The only thing that would be proven by this is that Green Hills cares a lot more about code optimization that Windows compilers do. You *can't* compare language speed in a vaccum. You can only compare *compilers*, which have many variables to their generated code speed besides the input language. The closest you can probably come is to try it using GCC, since they share a back-end (or at least, they do if you use gnat's GCC for the C compiles too). But even that's a bit unfair, as GCC's optimization capabilities are built around what C can provide, and it doesn't try to use any of the extra info that Ada provides to optimizers. Nonetheless, there is at least one instance of someone doing this and actually getting the *same executable* from both. --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html home email - mailto:dennison@telepath.com