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: 109fba,97482af7429a6a62 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,97482af7429a6a62 X-Google-Attributes: gid103376,public X-Google-Thread: 10d15b,97482af7429a6a62 X-Google-Attributes: gid10d15b,public From: RTOAL@lmumail.lmu.edu (Ray Toal) Subject: Re: Language Efficiency Date: 1995/04/05 Message-ID: #1/1 X-Deja-AN: 100937904 references: <3lmt64$stt@dplanet.p2k.cbis.com> <3lrrqk$kbj@usenet.INS.CWRU.Edu> <3ls7u0$3v1@stc06.ctd.ornl.gov> organization: Loyola Marymount University newsgroups: comp.lang.c++,comp.lang.ada,comp.lang.cobol Date: 1995-04-05T00:00:00+00:00 List-Id: In article <3ls7u0$3v1@stc06.ctd.ornl.gov> mbk@jt3ws1.etd.ornl.gov (Kennel) writes: >Harold P Zbiegien (bb206@cleveland.Freenet.Edu) wrote: >> In a previous article, robertb@cbis.com (Robert C. Bethel) says: >> >Anyone know of research papers that deal with the subject >> >of language efficiency? By efficiency I mean the quality >> >of machine binaries (code space, execution time, etc.) >> >given an identical program coded in several languages. >> > >> >Thanks >> >-- >> >Robert.Bethel@CBIS.Com >> > >> Shouldn't this be labeled "compiler efficiency" There may not be anything >> inherent between the efficiency of one language and another, >> but there sure >> is differences between the generated code coming out of compilers. >This is heresy but I disagree. >Different languages make fundamentally different choices resulting >in very different kinds and amounts of knowledge that is provided to the >compiler. Actually what is *more* important is what the language definitions *allow* compilers to get away with. Fortran compilers are allowed to assume that two arrays passed to the same subroutine/function do not alias each other (even if they do). So you'll have fast running code but you'll have to "trust the programmer". I'm not really sure why there would (in principle) be a difference in execution time between a Fortran program that was compiled without assuming "noalias" and an Ada program in which all checks were supressed. Alas, 30+ years of Fortran compiler technology shows that in practice there usually is... >Assuming an approximately constant level of knowledge and resources >between compiler groups this can make a huge difference in the speed >of executable code. Strong typing, and for that matter good uses of subtyping in Ada, of course help a good compiler optimize away checks. But when you compare Ada runtimes to those with languages that are essentially unchecked there are differences. Ray Toal