Putting closures on the heap

Greg_Morrisett@VACHE.VENARI.CS.CMU.EDU
Wed, 29 Jan 92 23:58:00 EST

          From comp.compilers

Related articles
Re: Compiling with Continuations/Andrew Appel eifrig@blaze.cs.jhu.edu (1992-01-27)
Re: Compiling with Continuations/Andrew Appel delacour@parc.xerox.com (Vincent Delacour) (1992-01-28)
Putting closures on the heap Greg_Morrisett@VACHE.VENARI.CS.CMU.EDU (1992-01-29)
| List of all articles for this month |

Newsgroups: comp.compilers
From: Greg_Morrisett@VACHE.VENARI.CS.CMU.EDU
Keywords: ML, storage
Organization: Compilers Central
References: 92-01-101 92-01-115
Date: Wed, 29 Jan 92 23:58:00 EST

Putting closures on the heap can have its advantages. It can provide
powerful language constructs (higher-order functions, callcc) that are
relatively cheap (no migration from the stack to the heap). It provides a
simple, uniform interface to garbage collection.


As an extended example, one can implement a *very* lightweight thread
package in SML/NJ using callcc/throw. Each thread is simply a
continuation, so you don't have to reserve stack space for it beforehand.
This means that you can reasonably have thousands of threads instead of a
few hundred.


Just my 2 cents.


-Greg Morrisett
  jgmorris@cs.cmu.edu


--


Post a followup to this message

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