Mr Breinholt writes
> On the other hand it would seem that pure functional languages would be
> an excellent match for using a stack based allocation system.
> I just started reading a book by Simon L. Peyton Jones, _Implementing
> Functional Languages_.
P17 of Peyton Jones "The Implementation of Functional Programming Language"
shows how to implement basic LISP operations of CONS HEAD TAIL in a purely
functional language with NO explicit provision of data-structures AT ALL.
So the rationale for requiring garbage collection in LISP [which is nothing
to do with the identification, or quasi-identification, of program and
data] is exactly present for all functional languages. The only debate is
whether Procedure Activation Records themselves should be allocated on a
stack or not.
The fact that functional languages inherently provide data-structures is
not new. I remember Peter Landin pointing it out in 1967, and of course,
it's inherent in Church's work in the 1930's.
Robin.
|