[plt-scheme] OT- why are compilers not written in scheme?

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Jan 5 07:31:55 EST 2010

Not that this disputes any of the excellent points in this thread, but
QEMU demonstrates one reason why a particular kind of compiler might
be written in C (or at least non-trivial parts of it):


The relevant punchline is that you get to reuse gcc in a very clever
way to get excellent performance for the _generated_ code.


On Tue, Jan 5, 2010 at 6:11 AM, Matthias Felleisen <matthias at ccs.neu.edu> wrote:
> On Jan 5, 2010, at 6:23 AM, Stephen De Gabrielle wrote:
>> (my apologies for OT post)
>> I was just listening to episode 57 of Software Engineering Radio (
>> http://www.se-radio.net/transcript-57-compiletime-metaprogramming )
>> I'm only 40 minutes in, but I'm wondering why C is the language of
>> compilers- when a Scheme subset would seem to be a better fit?
>> (excluding the obvious reason of not wanting to rewrite gcc)
>> Please forgive my ignorance of these issues, and my choice of list for
>> posting. Perhaps I should ask on the LTU discussion boards?
> 1. Yes, you are asking the wrong group.
> 2. Many compilers are written in Scheme and ML and Haskell, etc. They are ideally suited for this job because we understand the domain so well and because everything past parsing is about tree traversals (plus some graphs).
> 3. So we return to 1: why are there still so many people left who choose C to write compilers? You are asking the wrong group. We can only speculate while others can tell you that they are simply unaware of the advantages of FP (esp for compilers) with some clouded arguments about speed and space and programmers need to maintain them and other such stuff.
> -- Matthias
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.