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: 10d15b,97482af7429a6a62 X-Google-Attributes: gid10d15b,public X-Google-Thread: 103376,97482af7429a6a62 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Language Efficiency Date: 1995/04/21 Message-ID: #1/1 X-Deja-AN: 101368972 references: <3lmt64$stt@dplanet.p2k.cbis.com> <3lrrqk$kbj@usenet.INS.CWRU.Edu> organization: The Mitre Corp., Bedford, MA. newsgroups: comp.lang.c++,comp.lang.ada,comp.lang.cobol Date: 1995-04-21T00:00:00+00:00 List-Id: In article matt@physics10.berkeley.edu (Matt Austern) writes: > If certain optimizations are possible in principle in two different > languages, but if they are vastly more difficult in one language than > in the other, then it is both correct and misleading to say that > efficiency differences between the two languages are purely issues of > implementation. I have worked on two different compilers which adopted the same approach to optimization and gotos. Normal compilation assumed that there were no gotos in scope. If a goto was encountered, a switch was set and compillation restarted from the beginning. An elegent technique for languages where gotos are rare in practice but legal. (The compilers mentioned above were for Pascal and Ada, and developed by different companies.) In addition I know of at least one Ada compiler which lays out a record during processing of the declaration, and if it later encounters rep clauses, it just repeats the work from scratch. So, yes, in practice many compilers do ignore language features which make compilation or optimization more difficult, and have a completely different mode or routine when those features are encountered. With the Pascal compiler mentioned above, since it supported multiple compilation units, it was a "known rule" that you should put any gotos in the smallest possible compilation. An awful lot of optimization got turned off. The Ada compiler was much better behaved, about the only thing affected was spilling of register variables. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...