Lune

PLDI2020Top-tier venue

From folklore to fact: comparing implementations of stacks and continuations

Kavon Farvardin, John H. Reppy

Abstract

The efficient implementation of function calls and non-local control transfers is a critical part of modern language implementations and is important in the implementation of everything from recursion, higher-order functions, concurrency and coroutines, to task-based parallelism. In a compiler, these features can be supported by a variety of mechanisms, including call stacks, segmented stacks, and heap-allocated continuation closures.

An implementor of a high-level language with advanced control features might ask the question "what is the best choice for my implementation?" Unfortunately, the current literature does not provide much guidance, since previous studies suffer from various flaws in methodology and are outdated for modern hardware. In the absence of recent, well-normalized measurements and a holistic overview of their implementation specifics, the path of least resistance when choosing a strategy is to trust folklore, but the folklore is also suspect.

This paper attempts to remedy this situation by providing an "apples-to-apples" comparison of six different approaches to implementing call stacks and continuations. This comparison uses the same source language, compiler pipeline, LLVM-backend, and runtime system, with the only differences being those required by the differences in implementation strategy. We compare the implementation challenges of the different approaches, their sequential performance, and their suitability to support advanced control mechanisms, including supporting heavily threaded code. In addition to the comparison of implementation strategies, the paper's contributions also include a number of useful implementation techniques that we discovered along the way.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

8 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Lexical Effect Handlers, Directly cites Retrofitting effect handlers onto OCaml
  • Lexical Effect Handlers, Directly cites Continuing WebAssembly with Effect Handlers
  • Lexical Effect Handlers, Directly cites From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect Handlers
  • Continuing WebAssembly with Effect Handlers cites Retrofitting effect handlers onto OCaml
  • From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect Handlers cites Retrofitting effect handlers onto OCaml
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers8

  1. Retrofitting effect handlers onto OCamlK. C. Sivaramakrishnan, Stephen Dolan, Leo White, Tom Kelly et al.PLDI 2021 · 56 citations
  2. Continuing WebAssembly with Effect HandlersLuna Phipps-Costin, Andreas Rossberg, Arjun Guha, Daan Leijen et al.OOPSLA 2023 · 20 citations
  3. Lexical Effect Handlers, DirectlyCong Ma, Zhaoyi Ge, Edward Lee, Yizhou ZhangOOPSLA 2024 · 7 citations
  4. From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect HandlersMarius Müller, Philipp Schuster, Jonathan Lindegaard Starup, Klaus Ostermann et al.OOPSLA 2023 · 7 citations
  5. Explicit Effects and Effect Constraints in ReMLMartin ElsmanPOPL 2024 · 4 citations

Related papers

  1. Virtualizing ContinuationsCong Ma, Jonghyun Jung, Yizhou ZhangPLDI 2026
  2. Sharded Elimination and Combining for Highly-Efficient Concurrent StacksAjay Singh, Nikos Metaxakis, Panagiota FatourouPPoPP 2026
  3. Automatic Parallelism ManagementSam Westrick, Matthew Fluet, Mike Rainey, Umut A. AcarPOPL 2024 · 7 citations
  4. Compiler and runtime support for continuation marksMatthew Flatt, R. Kent DybvigPLDI 2020 · 9 citations
  5. Work Packets: A New Abstraction for GC Software Engineering, Optimization, and InnovationWenyu Zhao, Stephen M. Blackburn, Kathryn S. McKinleyOOPSLA 2025 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines