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

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Jan 5 07:11:12 EST 2010

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

Posted on the users mailing list.