Modular Substructural Constraints for Embedded DSLs
Substructural type systems provide static guarantees about resource usage in programs. In most practical systems, how- ever, the available usage constraints and their composition are predetermined by the language design, with only lim- ited support for application programmers to customize them. Many domains require finer control over resource usage: different operations may demand distinct or combined usage policies, and the composition of restricted values is often domain-specific. We present a staging-based technique for expressing modular substructural constraints on function arrows in embedded domain-specific languages, enabling resource disciplines to be customized to the heterogeneous requirements of real-world domains. Staging allows resource usage to be tracked in types while enforcing constraints at compile time, without modifying the host-language compiler. Our approach introduces restricted functions parameter- ized by a multiplicity and a constraint arity, together with user-defined custom connectives that determine resource usage. Constraints are enforced at compile time through type-level programming, requiring no changes to the host compiler. We formalize the design as an extension of the simply-typed lambda calculus and implement it in Scala 3. Through several case studies, we show how domain-specific constraints can be expressed in a mainstream language, and in a larger Linear Datalog case study, demonstrate that the approach introduces no performance overhead.
Mon 29 JunDisplayed time zone: Brussels, Copenhagen, Madrid, Paris change
14:00 - 15:30 | |||
14:00 22mTalk | Programmable record types in Haskell GPCE | ||
14:22 22mTalk | Modular Substructural Constraints for Embedded DSLs GPCE Anna Herlihy EPFL, Amir Shaikhha University of Edinburgh, Anastasia Ailamaki EPFL, Martin Odersky EPFL | ||
14:45 22mTalk | Metis: A Compositional DSL for Board Games and Game Tree Search GPCE | ||
15:07 22mTalk | Synthesizing Recursive Functional Programs via Structure-Element Separation GPCE | ||