Subject: Re: Implementation issues
From: (Rob Warnock)
Date: 1998/07/17
Newsgroups: comp.lang.scheme
Message-ID: <6omq0e$>
Andy Gaynor  <> wrote:
| Overall, which do you think is better, putting activation
| records in the heap or maintaining a stack for them?

Have you read this yet?

    Dybvig, R. Kent. "Three Implementation Models for Scheme".
    University of North Carolina Computer Science Technical
    Report 87-011 [Ph.D.  Dissertation], April 1987.

| The deciding vote, I guess, is that the ratio of continuation usage
| to the normal creation and reclamation of activation records is low.
| So stack wins.

Usually. But there are some, e.g.:

    Appel, Andrew W. "Simple generational garbage collection and fast
    allocation". Software Practice and Experience, 19(2):171-183, 1989.

who would say that with a high-quality generational garbage collector,
especially one that uses a generation-0 "nursery" that's matched to the
secondary cache size [per Ungar], that heap-based allocation can be as
fast & efficient as stack-based allocation. (And then there's Henry Baker's
"Cheney on the MTA" <URL:>,
which uses the C stack *as* generation-0, but that's another story...)

So while the vast majority of performance-oriented implementations use
a linear stack for activation records, it's not necessarily the *only*
"right" way...


Rob Warnock, 7L-551
Silicon Graphics, Inc.		Phone: 650-933-1673
2011 N. Shoreline Blvd.		FAX: 650-933-4392
Mountain View, CA  94043	PP-ASEL-IA