English

Compiling with Continuations and LLVM

Programming Languages 2019-01-01 v2

Abstract

LLVM is an infrastructure for code generation and low-level optimizations, which has been gaining popularity as a backend for both research and industrial compilers, including many compilers for functional languages. While LLVM provides a relatively easy path to high-quality native code, its design is based on a traditional runtime model which is not well suited to alternative compilation strategies used in high-level language compilers, such as the use of heap-allocated continuation closures. This paper describes a new LLVM-based backend that supports heap-allocated continuation closures, which enables constant-time callcc and very-lightweight multithreading. The backend has been implemented in the Parallel ML compiler, which is part of the Manticore system, but the results should be useful for other compilers, such as Standard ML of New Jersey, that use heap-allocated continuation closures.

Keywords

Cite

@article{arxiv.1805.08842,
  title  = {Compiling with Continuations and LLVM},
  author = {Kavon Farvardin and John Reppy},
  journal= {arXiv preprint arXiv:1805.08842},
  year   = {2019}
}

Comments

In Proceedings ML/OCAML 2016, arXiv:1812.10891

R2 v1 2026-06-23T02:04:53.915Z