Cactus Environment Machine: Shared Environment Call-by-Need

George Stelle, Darko Stefanovic, Stephen L. Olivier, Stephanie Forrest

Research output: Chapter in Book/Report/Conference proceedingConference contribution


Existing machines for lazy evaluation use a flat representation of environments, storing the terms associated with free variables in an array. Combined with a heap, this structure supports the shared intermediate results required by lazy evaluation. We propose and describe an alternative approach that uses a shared environment to minimize the overhead of delayed computations. We show how a shared environment can act as both an environment and a mechanism for sharing results. To formalize this approach, we introduce a calculus that makes the shared environment explicit, as well as a machine to implement the calculus, the Cactus Environment Machine. A simple compiler implements the machine and is used to run experiments for assessing performance. The results show reasonable performance and suggest that incorporating this approach into real-world compilers could yield performance benefits in some scenarios.

Original languageEnglish (US)
Title of host publicationTrends in Functional Programming - 17th International Conference, TFP 2016, Revised Selected Papers
EditorsJohn Hughes, David Van Horn
PublisherSpringer Verlag
Number of pages20
ISBN (Print)9783030148041
StatePublished - 2019
Externally publishedYes
Event17th International Symposium on Trends in Functional Programming, TFP 2016 - College Park, United States
Duration: Jun 8 2016Jun 10 2016

Publication series

NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Volume10447 LNCS
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349


Conference17th International Symposium on Trends in Functional Programming, TFP 2016
Country/TerritoryUnited States
CityCollege Park

ASJC Scopus subject areas

  • Theoretical Computer Science
  • General Computer Science


Dive into the research topics of 'Cactus Environment Machine: Shared Environment Call-by-Need'. Together they form a unique fingerprint.

Cite this