arrow
Return

Explicit Level Imports

delete2026-01-01
delete0
PRE
AI
M
Matthew C. Pickering *
R
Rodrigo Mesquita
A
Adam Gundry
DOI:10.1007/978-3-031-99751-8_3delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Cross-stage persistence rules are commonly admitted in multi-stage programming languages. These rules codify the assumption that all module and package dependencies are available at all stages. However, in practice, only a small number of dependencies may be needed at each particular stage. This paper introduces Explicit Level Imports, a mechanism which gives programmers precise control about which dependencies are required at each stage. Imports are annotated with a modifier which brings identifiers into scope at a specific level. This precision means it is straightforward for the compiler to work out what is exactly needed at each stage, and only provide that. The result is faster compilation times and the potential for improved cross-compilation support. We have implemented these ideas in GHC Haskell, consider a wide variety of practical considerations in the design, and finally demonstrate that the feature solves a real-world issue in a pragmatic way.
Keywords:
Staging
Modules
Compile-time code generation
Haskell

Journal

T
TRENDS IN FUNCTIONAL PROGRAMMING, TFP 2025
IF:
0
Papers:
20
Citations:
0

Organization

No organization information available
Cited Papers

Cited Papers

Staged Compilation with Module Functors
err2024-08-15
err0
PREAI
errChiang,Tsung-Ju; Yallop,Jeremy; White,Leo; Xie,Ningning
errShare
errSave
errShare
errSave
MacoCaml: Staging Composable and Compilable Macros
err2023-08-30
err0
PREAI
errXie,Ningning; White,Leo; Nicole,Olivier; Yallop,Jeremy
errShare
errSave
errShare
errSave
researcher View more