Stack-Copying Delimited Continuations for Scala Native
Year: 2024
Type: conference-paper
Abstract: Scala, an industrial-strength functional and object-oriented programming language, is in need for an ergonomic approach to asynchronous programming. Project Loom provides direct-style concurrency to Scala on the JVM, which leaves its low-footprint high-performance backend Scala Native looking for an equivalent mechanism. We present a design and implementation of delimited continuations, a powerful control flow mechanism that provides the fundamental building block for direct-style concurrent and effectful programming, in Scala Native. Our implementation aims to preserve the unique advantages of the Native target: zero-cost C interoperability, runtime modularity and debugger compatibility. Through a detailed discussion of the implementation, we show that despite the limitations with stack address stability, it meets all the requirements of Scala Native while exhibiting comparable performance to our JVM counterpart.
Authors: Cao Nguyen Pham, Martin Odersky
Institution: École Polytechnique Fédérale de Lausanne
Language: English
Subfield: Artificial Intelligence
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W4402527013
