Exploring the limitations of Contextual Modal Type Theory for Multi-Stage Programming
Multi-stage programming is a long-standing paradigm used for systematically reconciling abstraction and performance via runtime code generation. Two lines of research have emerged. One approach, based on linear temporal types (e.g. MetaOCaml), enables compositional symbolic evaluation but fails to enable safe code execution and interacts poorly with effects. The other approach, based on a contextual relaxation of modal S4 types (CMTT), does not present these problems but is known to be less expressive.
This work wants to build on the numerous theoretical works on CMTT attempting to close this gap. More specifically, we harness the insights of Jang et al. with system F polymorphism — a significant boost in expressiveness; and those of Murase et al. with contextual polymorphism — significantly narrowing, if not closing the gap with temporal types. We aim to address some of the questions they leave open: what is the relationship between these two calculi? Is contextual polymorphism necessary to bridge the gap, and is it sufficient to express more practical MetaOCaml applications?
In this work, we explore these questions with a practical perspective. We implement Lys, a language based on a subset of Jang et al.‘s calculus, and use it to attempt to reimplement MetaOCaml applications — a stream fusion library, and a tagless final interpreter. This enables us to shed light on the relationship between System F CMTT and contextual polymorphic CMTT. We provide empirical evidence that System F alone fails to reach the expressiveness of MetaOCaml and that general first-class contexts are needed for practical applications. We also find that System F polymorphism can, in some cases, simulate context polymorphism, with the caveat of additional runtime overhead. We leave further exploration based on these insights to future work.
Wed 17 JanDisplayed time zone: London change
18:15 - 20:00 | |||
18:15 4mPoster | A Denotational Approach to Release/Acquire Concurrency Student Research Competition Yotam Dvir Tel Aviv University | ||
18:19 4mTalk | A Lean Formalization of Cedar Student Research Competition Bhakti Shah University of Chicago | ||
18:24 4mTalk | A Substructural Type and Effect System Student Research Competition Orpheas van Rooij Radboud University | ||
18:29 4mPoster | A type-safe generalized editor calculus (Extended Abstract) Student Research Competition Nikolaj Rossander Kristensen Department of Computer Science, Aalborg University, Benjamin Bennetzen Department of Computer Science, Aalborg University, Peter Buus Steffensen Department of Computer Science, Aalborg University, Andreas Tor Mortensen Department of Computer Science, Aalborg University | ||
18:34 4mPoster | Compilation Quotient (CQ): A Metric for the Compilation Hardness of Programming Languages Student Research Competition Vince Szabó Delft University of Technology | ||
18:38 4mPoster | Compositional Programming with Full Iso-recursive Types Student Research Competition Litao Zhou Shanghai Jiao Tong University; University of Hong Kong | ||
18:43 4mPoster | Differential Privacy in an Impure World Student Research Competition Damián Arquez University of Chile | ||
18:48 4mPoster | Effect handlers in Zig (extended abstract) Student Research Competition Alessio Duè University of Pisa | ||
18:53 4mTalk | Efficient Incremental Computation for Halide Student Research Competition Tyler Hou University of California, Berkeley Pre-print | ||
18:57 4mTalk | Embedding Pointful Array Programming in Python Student Research Competition Jakub Bachurski University of Cambridge | ||
19:02 4mPoster | Exploring the limitations of Contextual Modal Type Theory for Multi-Stage Programming Student Research Competition Theo Wang University of Oxford | ||
19:07 4mPoster | From Java to Kotlin with Contextual Equality Saturation Student Research Competition Alexandre Drewery INRIA | ||
19:12 4mPoster | GPU-Accelerated Synthesis of Boolean Circuits Student Research Competition Justin Du University of California, San Diego, Rana Lulla University of California San Diego, Melody Ruth University of California San Diego | ||
19:17 4mTalk | HOL4P4: A Heapless Small-Step Semantics and Type System for P4 Student Research Competition Anoud Alshnakat KTH Royal Institute of Technology, Roberto Guanciale KTH Royal Institute of Technology, Mads Dam KTH | ||
19:21 4mPoster | Linking Session-Typed Channels in Separation Logic Student Research Competition Thomas Somers Radboud University | ||
19:26 4mPoster | Optimization of a Gradual Verifier: Lazy evaluation of Iso-recursive Predicates as Equi-recursive at Runtime Student Research Competition Jan-Paul Ramos-Davila Cornell University | ||
19:31 4mPoster | Optimization of the Context-Free Language Reachability Matrix-Based Algorithm Student Research Competition Ilya Muravjov Saint Petersburg State University | ||
19:36 4mPoster | PiR (πr): Probabilistic Interpretation of Robustness Student Research Competition Abhinandan Pal University of Birmingham | ||
19:40 4mTalk | Session-Typed Effect Handlers Student Research Competition Wenhao Tang University of Edinburgh | ||
19:45 4mPoster | Tail: A Typed and Structured Document Editor Student Research Competition Alperen Keles University of Maryland at College Park | ||
19:50 4mPoster | Towards programmatic reinforcement learning: the case of deterministic gridworlds Student Research Competition Guruprerana Shabadi École Polytechnique, Institut Polytechnique de Paris | ||
19:55 4mPoster | Zero-Cost Capabilities: Retrofitting Effect Safety in Rust Student Research Competition George Berdovskiy University of California, Davis |