Re: Compiler and interpreter origins

torbenm@diku.dk (Torben Ęgidius Mogensen)
3 Sep 2004 12:30:15 -0400

          From comp.compilers

Related articles
[7 earlier articles]
Re: Compiler and interpreter origins slimick@venango.upb.pitt.edu (John Slimick) (2004-08-09)
Re: Compiler and interpreter origins Martin.Ward@durham.ac.uk (Martin Ward) (2004-08-10)
Re: Compiler and interpreter origins samiam@moorecad.com (Scott Moore) (2004-08-10)
Re: Compiler and interpreter origins beliavsky@aol.com (2004-08-11)
Re: Compiler and interpreter origins david.thompson1@worldnet.att.net (Dave Thompson) (2004-08-23)
Re: Compiler and interpreter origins jeremy.wright@microfocus.com (Jeremy Wright) (2004-08-25)
Re: Compiler and interpreter origins torbenm@diku.dk (2004-09-03)
Re: Compiler and interpreter origins gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-09-07)
| List of all articles for this month |

From: torbenm@diku.dk (Torben Ęgidius Mogensen)
Newsgroups: comp.compilers
Date: 3 Sep 2004 12:30:15 -0400
Organization: Department of Computer Science, University of Copenhagen
References: 04-07-077 04-08-010 04-08-033 04-08-108 04-08-146
Keywords: history, Cobol
Posted-Date: 03 Sep 2004 12:30:14 EDT

Jeremy Wright <jeremy.wright@microfocus.com> writes:


> Dave Thompson wrote:
> >
> > On 9 Aug 2004 00:28:14 -0400, "Nick Roberts" <nick.roberts@acm.org>
> > wrote:
> >
> > > On 4 Aug 2004 02:44:48 -0400, Jeff Kenton <Jeffrey.Kenton@comcast.net>
> > [ asked about selfmodifying code in the Good Old Days ]
> >
> > > Originally, the COBOL language had an
> > >
> > > ALTER x TO PROCEED TO y
> > >
> > > statement, which modified a GOTO statement (itself labelled x),
> > > changing its destination from whatever it was before to y.
>
> ALTER need not be implemented using self modifying code. The set of
> targets that an alterable goto can be set to is known at compile time.
> The alterable goto is then just an indexed jump, and the alters set
> the index.


This is true of any self-modifying code: You can work around it at
some small cost in performance. In case of the ALTER, you replace a
direct jump with a jump through a jump table. In extreme cases, you
can add what amounts to small interpreters to handle the apparent
self-modification.


If you are working with a system that uses interpreted byte-code, the
difference becomes muddled: If a program modifies its byte-code, is
that self-modifying code? The byte-code is definitely modified, but
you can argue that that the actual code is the interpreter, which
isn't modified. If you add JIT compilation to the byte-code
interpreter, the issue becomes even murkier.


Torben


Post a followup to this message

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