ICFP 2023
Mon 4 - Sat 9 September 2023 Seattle, Washington, United States
Thu 7 Sep 2023 15:30 - 16:00 at B - Fifth Avenue - Data representation Chair(s): Lennart Augustsson

Initially present only in functional languages such as OCaml and Haskell, Algebraic Data Types (ADTs) have now become pervasive in mainstream languages, providing nice data abstractions and an elegant way to express functions through pattern matching. Unfortunately, ADTs remain seldom used in low-level programming. One reason is that their increased convenience comes at the cost of abstracting away the exact memory layout of values. Even Rust, which tries to optimize data layout, severely limits control over memory representation. In this article, we present a new approach to specify the data layout of rich data types based on a dual view: a source type, providing a high-level description available in the rest of the code, along with a memory type, providing full control over the memory layout. This dual view allows for better reasoning about memory layout, both for correctness, with dedicated validity criteria linking the two views, and for optimizations that manipulate the memory view. We then provide algorithms to compile constructors and destructors, including pattern matching, to their low-level memory representation. We prove our compilation algorithms correct, implement them in a tool called ribbit that compiles to LLVM IR, and show some early experimental results.

Slides (slides-2023.pdf)402KiB

Thu 7 Sep

Displayed time zone: Pacific Time (US & Canada) change

15:00 - 16:00
Data representationICFP Papers and Events at B - Fifth Avenue
Chair(s): Lennart Augustsson Epic Games
15:00
30m
Talk
Read/write factorizable programsJFP Presentation
ICFP Papers and Events
Siddharth Bhaskar University of Copenhagen, Jakob Grue Simonsen University of Copenhagen
Link to publication DOI
15:30
30m
Talk
Bit-Stealing Made Legal: Compilation for Custom Memory Representations of Algebraic Data Types
ICFP Papers and Events
Thaïs Baudon ENS de Lyon & LIP, Gabriel Radanne Inria, Laure Gonnord Univ. Grenoble Alpes, Grenoble INP, LCIS, Valence, France
DOI Pre-print Media Attached File Attached