|data allocation in interpreters email@example.com (2006-05-30)|
|Re: data allocation in interpreters firstname.lastname@example.org (Pascal Bourguignon) (2006-05-30)|
|Re: data allocation in interpreters email@example.com (2006-06-03)|
|Re: data allocation in interpreters firstname.lastname@example.org (George Peter Staplin) (2006-06-03)|
|Re: data allocation in interpreters gmt@CS.Arizona.EDU (2006-06-07)|
|From:||email@example.com (Hans Aberg)|
|Date:||3 Jun 2006 18:52:50 -0400|
|Posted-Date:||03 Jun 2006 18:52:50 EDT|
Pascal Bourguignon <firstname.lastname@example.org> wrote:
> email@example.com writes:
> > What are common techniques for data allocation (strings, high-level
> > data structures) in interpreters?
> > What do you think, how is it implemented in the famous interpreters?
> Depends on the programming language.
As you say, it depends on the programming language used, but also on the
ambition level of the interpreter implementation. If one is a singly
implementer, it might be suitable with a programming language like C++
plus the use of a reference count - C++ does not currently support
the implementations of any other GC (the Boehm GC goes in a a layer
between the compiler and the platform), but the next revision might. If
using Java/Objective C, one can get this cleanup via the language.
> But in most other programming languages, there's a garbage collector.
For a more optimized interpreter, C is the better choice, and an
interpreter like Hugs <http://haskell.org/hugs/> uses a two-space copying
GC. I think this is typical choice of GC for many interpreters, at
least before more advanced forms of GC are considered.
Return to the
Search the comp.compilers archives again.