Re: Language used to write compilers

Martin Ward <Martin.Ward@durham.ac.uk>
31 Dec 2004 12:59:49 -0500

          From comp.compilers

Related articles
[2 earlier articles]
Re: Language used to write compilers nmm1@cus.cam.ac.uk (2004-12-30)
Re: Language used to write compilers s.bosscher@student.tudelft.nl (stevenb) (2004-12-30)
Re: Language used to write compilers vbdis@aol.com (2004-12-30)
Re: Language used to write compilers dido@imperium.ph (Rafael 'Dido' Sevilla) (2004-12-30)
Re: Language used to write compilers nick.roberts@acm.org (Nick Roberts) (2004-12-30)
Re: Language used to write compilers samiam@moorecad.com (Scott Moore) (2004-12-31)
Re: Language used to write compilers Martin.Ward@durham.ac.uk (Martin Ward) (2004-12-31)
Re: Language used to write compilers nmm1@cus.cam.ac.uk (2004-12-31)
Re: Language used to write compilers nmm1@cus.cam.ac.uk (2004-12-31)
Re: Language used to write compilers idbaxter@semdesigns.com (Ira Baxter) (2004-12-31)
Re: Language used to write compilers Peter_Flass@Yahoo.com (Peter Flass) (2005-01-01)
Re: Language used to write compilers nmm1@cus.cam.ac.uk (2005-01-03)
Re: Language used to write compilers napi@cs.indiana.edu (2005-01-03)
[2 later articles]
| List of all articles for this month |

From: Martin Ward <Martin.Ward@durham.ac.uk>
Newsgroups: comp.compilers
Date: 31 Dec 2004 12:59:49 -0500
Organization: Compilers Central
References: 04-12-148 04-12-172
Keywords: practice
Posted-Date: 31 Dec 2004 12:59:49 EST

Nick Roberts <nick.roberts@acm.org> wrote:
> "Joe H." <joe_hesse@actcx.com> wrote:
> > Question - what languages are used to write compilers?


Many languages are used to write compilers: I know of one compiler
that was written in COBOL: because that's all the compiler writer knew!


Perhaps you mean: what languages *should* be used to write compilers?


> There are three essential aspects to writing a good compiler (which
> probably apply to most software anyway): it is well-designed; it is
> correct; it is efficient. Of these three, the first two are far more
> important than the third.
> ...
> A possible fourth aspect will be that the compiler emits
> well-optimised code, if this is in fact a specific requirement of your
> compiler.


I would put the efficiency of the generated code higher than the
efficiency of the compiler. Generally, more CPU cycles are spent
executing compiled code than on running the compiler (with the
possible exception of Gentoo Linux systems...)


If the *language* you are compiling is well designed so that modules
can be compiled separately while still generating efficient code, then
compile times on modern systems are unlikely to be an issue. Good
debugging is *much* more important: how many recompiles are caused by
the need to track down bugs? Eliminating these recompiles is a bigger
gain than speeding them up!


--
Martin


Martin.Ward@durham.ac.uk http://www.cse.dmu.ac.uk/~mward/ Erdos number: 4


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.