Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!cambridge.apple.com!alms
From: alms@cambridge.apple.com (Andrew L. M. Shalit)
Newsgroups: comp.object
Subject: Re: OOD applied to interpreters and compilers
Message-ID: 
Date: 2 Oct 89 19:14:41 GMT
References: <26873@genrad.UUCP>
Sender: news@cambridge.apple.com
Organization: Apple Computer Inc, Cambridge, MA
Lines: 30
In-reply-to: charlie@genrad.com's message of 2 Oct 89 16:58:26 GMT

In article <26873@genrad.UUCP> charlie@genrad.com (Charlie D. Havener) writes:


   The examples I have seen on Object Oriented Design apply 
   nicely to problems like graphic window systems and to problems
   in which there are real physical objects one can think about.
   It is not at all clear to me how to apply OOD or to use Object
   oriented programming style to the design of program language
   compilers or interpreters. 

   There seems to be a classic way to do these things, i.e. lexer-
   parser-code generator that is well established. 

   Can someone who is comfortable with OOD comment on its applicability
   to such problems? Is OOD a poor match to some problems? Will anyone
   admit it?

Henry Lieberman (then of the MIT AI-Lab, now of the Media Lab) wrote
an interesting series of papers on object-oriented interpreters. I
don't know if he ever got past the prototype stage, but he did
demonstrate some very powerful uses of objects in interpreter design.
If I remember correctly, he started with the notion of a 'program'
object, which knows how to respond to the 'run' message.  (He actually
worked in Lisp, so it was an 'expression' object and an 'eval'
message.)  By specializing 'run', you can incrementally modify the
semantics of the language you are interpreting.

Sorry, I can't supply references.  I'm actually not sure if these
papers were ever really published.  Perhaps someone else reading
this would know.