Compiling with Continuations and LLVM

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...

Full description

Bibliographic Details
Main Authors: Kavon Farvardin, John Reppy
Format: Article
Language:English
Published: Open Publishing Association 2018-12-01
Series:Electronic Proceedings in Theoretical Computer Science
Online Access:http://arxiv.org/pdf/1805.08842v1
_version_ 1811277621353250816
author Kavon Farvardin
John Reppy
author_facet Kavon Farvardin
John Reppy
author_sort Kavon Farvardin
collection DOAJ
description 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.
first_indexed 2024-04-13T00:20:04Z
format Article
id doaj.art-59a56bdf71514e0196c061c9124f975a
institution Directory Open Access Journal
issn 2075-2180
language English
last_indexed 2024-04-13T00:20:04Z
publishDate 2018-12-01
publisher Open Publishing Association
record_format Article
series Electronic Proceedings in Theoretical Computer Science
spelling doaj.art-59a56bdf71514e0196c061c9124f975a2022-12-22T03:10:48ZengOpen Publishing AssociationElectronic Proceedings in Theoretical Computer Science2075-21802018-12-01285Proc. ML/OCAML 201613114210.4204/EPTCS.285.5:3Compiling with Continuations and LLVMKavon Farvardin0John Reppy1 University of Chicago University of Chicago 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.http://arxiv.org/pdf/1805.08842v1
spellingShingle Kavon Farvardin
John Reppy
Compiling with Continuations and LLVM
Electronic Proceedings in Theoretical Computer Science
title Compiling with Continuations and LLVM
title_full Compiling with Continuations and LLVM
title_fullStr Compiling with Continuations and LLVM
title_full_unstemmed Compiling with Continuations and LLVM
title_short Compiling with Continuations and LLVM
title_sort compiling with continuations and llvm
url http://arxiv.org/pdf/1805.08842v1
work_keys_str_mv AT kavonfarvardin compilingwithcontinuationsandllvm
AT johnreppy compilingwithcontinuationsandllvm