Polymorphic Metaprogramming with Memory Management -- An Adjoint Analysis of Metaprogramming
Junyoung Jang, Brigitte Pientka

TL;DR
Elevator introduces a polymorphic framework for metaprogramming that manages multiple memory regions with adjoint modalities, enabling efficient code generation and resource guarantees through a logical and type-safe approach.
Contribution
It extends logical models of metaprogramming by incorporating memory modes and preorder relations, ensuring mode safety and resource guarantees.
Findings
Proves substructurality of variable references.
Establishes type safety of the language.
Guarantees mode safety during evaluation.
Abstract
We describe Elevator, a unifying polymorphic foundation for metaprogramming with memory management based on adjoint modalities. In this setting, we distinguish between multiple memory regions using modes where each mode has a specific set of structural properties. This allows us not only to capture linear (i.e. garbage-free) memory regions and (ordinary) intuitionistic (i.e. garbage-collected or persistent) memory regions, but also to capture accessibility between the memory regions using a preorder between modes. This preorder gives us the power to describe monadic and comonadic programming. As a consequence, it extends the existing logical view of metaprogramming in two directions: first, it ensures that code generation can be done efficiently by controlling memory accesses; second, it allows us to provide resource guarantees about the generated code (i.e. code that is for example…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Distributed and Parallel Computing Systems · Evolutionary Algorithms and Applications
