Re: Language used to write compilers

nmm1@cus.cam.ac.uk (Nick Maclaren)
31 Dec 2004 13:01:36 -0500

          From comp.compilers

Related articles
[3 earlier articles]
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)
Re: Language used to write compilers vbdis@aol.com (2005-01-09)
[1 later articles]
| List of all articles for this month |

From: nmm1@cus.cam.ac.uk (Nick Maclaren)
Newsgroups: comp.compilers
Date: 31 Dec 2004 13:01:36 -0500
Organization: University of Cambridge, England
References: 04-12-148 04-12-172
Keywords: courses, practice
Posted-Date: 31 Dec 2004 13:01:36 EST

Nick Roberts <nick.roberts@acm.org> wrote:
>My advice for someone writing a compiler for the first time is to use
>as high level a language as you possibly can. There are plenty of
>languages readily available that are much higher level than Java (and
>obviously vastly more so than C or C++).


The same applies to pretty well any other application, which is not
actually dominated by system interfacing or performance-critical,
low-level code. Many numeric programmers prototype in Matlab, and
Python has a lot going for it as a compiler development language.


Note Python and not Perl. The former has good error checking, and you
will usually be told "nonsense" when you make a simple mistake.
Mistakes in Perl are often other, legal constructs or (worse) illegal
ones that are not detected, with consequences that can be bizarre. In
THIS sense, Python is a much higher level language than Perl.


Regards,
Nick Maclaren.
[I would argue that perl with the -w option is about as high level,
and I don't find many bugs in my perl code due to one valid thing
being mistyped as another, but we can argue about that separately.
Perl definitely has much larger application libraries than Python,
but unless you want to do something like compile to XML, I can't
think of many that would be particularly useful in a compiler.
-John]



Post a followup to this message

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