'Learning Compilers': Functional vs. Imperative Host?

Jim Witte <jswitte@spam.bloomington.in.us>
19 Mar 2004 23:48:38 -0500

          From comp.compilers

Related articles
'Learning Compilers': Functional vs. Imperative Host? jswitte@spam.bloomington.in.us (Jim Witte) (2004-03-19)
Re: 'Learning Compilers': Functional vs. Imperative Host? torbenm@diku.dk (2004-03-26)
Re: 'Learning Compilers': Functional vs. Imperative Host? jswitte@bloomington.in.us (Jim Witte) (2004-04-03)
Re: 'Learning Compilers': Functional vs. Imperative Host? jswitte@bloomington.in.us (Jim Witte) (2004-04-03)
Re: 'Learning Compilers': Functional vs. Imperative Host? jswitte@bloomington.in.us (Jim Witte) (2004-04-03)
Re: Re: 'Learning Compilers': Functional vs. Imperative Host? nmh@t3x.org (Nils M Holm) (2004-04-03)
| List of all articles for this month |

From: Jim Witte <jswitte@spam.bloomington.in.us>
Newsgroups: comp.compilers
Date: 19 Mar 2004 23:48:38 -0500
Organization: IU
Keywords: functional, practice, comment
Posted-Date: 19 Mar 2004 23:48:38 EST

Hi,


    I'm new to comp.compilers, so this question may have been *well*
hashed (no pun intended) before, and I don't particularly want to
start a functional language war here, but... I'm taking CS at Indiana
University Bloomington, where the 2-course compiler sequence is *very*
heavily tilted toward writing compilers in Scheme, both as the
"source" language that is to be compiled, and the host in which the
compiler is written. Now I know that (with varying amounts of
difficulty), probably almost anything can be turned into Scheme, which
could then be compiled iwth the tools made here..


    But I also get the feeling (although I haven't actually taken the
compilers courses) that we never actually learn how to use "standard"
parsing tools such as lexx and yacc, which I would think would be nice
to know if you're going to write compilers in a host other than
Scheme..


    Is there a general consensus on which host language is better for a
compiler to be written in? What do "large companies" (meaning MS,
Apple, Metrowerks, etc) use for their compilers (as far as anyone
knows)? I know that Metrowerks uses an intermediate-language of some
sort, so I suppose that the translator from the source language to the
IL could be written in an imperative host, and the compiler from the
IL down to machine code written in a functional host, but that's just
a guess..


Jim Witte
jswitte@bloomington.in.us
Indiana University CS
[Scheme is a great language for compiler courses because you can
concentrate on the data structures and algorithms without getting
bogged down in manual storage management and pointer bugs like you do
in C and C++. I think the reason you see few commercial compilers
written in Scheme or Lisp is partly that they're still seen as
languages for AI, not for real work, and partly (a big part) that few
Scheme or Lisp systems make it easy to package up program to run from
a command line like you can with C programs. -John]


Post a followup to this message

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