Re: Language used to write compilers

nmm1@cus.cam.ac.uk (Nick Maclaren)
30 Dec 2004 00:58:39 -0500

          From comp.compilers

Related articles
Language used to write compilers joe_hesse@actcx.com (Joe H.) (2004-12-29)
Re: Language used to write compilers dido@imperium.ph (Rafael 'Dido' Sevilla) (2004-12-30)
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)
[11 later articles]
| List of all articles for this month |
From: nmm1@cus.cam.ac.uk (Nick Maclaren)
Newsgroups: comp.compilers
Date: 30 Dec 2004 00:58:39 -0500
Organization: University of Cambridge, England
References: 04-12-148
Keywords: practice, courses
Posted-Date: 30 Dec 2004 00:58:38 EST



Joe H. <joe_hesse@actcx.com> wrote:
>I am thinking of taking a university course in compiler design. The
>instructor has chosen a book that teaches compiler implementation in
>Java. I always thought that compilers were usually written in C/C++.
>
>Question - what languages are used to write compilers? My world is
>Unix/Linux - should I wait until a course is offered using C/C++?
>
>[No. Compiler design is about algorithms and data structures, which
>are the same no matter what language you're using. And anyway, for
>most purposes Java is just C++ with some of the cruft stripped out and
>garbage collection added. The GC makes it a lot easier to whip up
>little sample programs. -John]


Hmm. Firstly, I would say "a little easier" - compilers are pretty
simple programs in terms of memory management.


Secondly, and more importantly, ignoring those aspects leads to the
sort of abominable compilers that we are inflicted with today. Yes, I
manage two systems where the compilers make unreasonable demands on
the configuration - specifically that there be no memory limits (even
for compiling the null program).


Exactly how do I configure a system so that users who miscalculate
array sizes don't exhaust memory and swap, causing other users'
programs and even the system to crash, and still enable the use of
those compilers? There are similar problems with /tmp, too.


Yes, I know that I am not going to win on this one, but I do wish a
bit more effort would be put into teaching the software engineering
of compilers.


Slightly off-topic, but indicative, is the fact that almost no
compilers identify the line for both ends of a bracketting mismatch.
Why not? It is TRIVIAL to do in 95% of cases. But, for at least 50
years, it has been a blind spot for compiler writers. And yet it
is well-known to be a continual, low-level sink of effort for people
working on large codes.


Regards,
Nick Maclaren.


Post a followup to this message

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