Seamless Scope-Safe Metaprogramming through Polymorphic Subtype Inference (Short Paper)

Practical metaprogramming applications often involve manipulating open code fragments, which is easy to get wrong in the absence of static verification that all variable occurrences remain correctly bound. Many approaches have been proposed to verify the type- and scope-safety of metaprograms, but these approaches are either incomplete or cumbersome, imposing heavy type annotation or proof obligation burdens on metaprogrammers. In this short paper, we propose a new type system to statically keep track of the context requirements of code fragments. Our system uses a novel combination of Boolean-algebraic subtyping and first-class polymorphic type inference techniques to alleviate the annotation burden. The former provides the ability to encode scope requirements as unions of types and the latter allows these types to be locally quantified through a flexible form of polymorphic subtyping. We formalize this type system and demonstrate its implementation in the nascent MLscript functional and object-oriented programming language.

Authors

Institutions

Publication Details

Published
2024-10-17
DOI
https://doi.org/10.1145/3689484.3690733
Citations
1
Primary Topic
Parallel Computing and Optimization Techniques
Type
article
Field-Weighted Citation Impact
0.49
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Seamless Scope-Safe Metaprogramming through Polymorphic Subtype Inference (Short Paper)

Lionel Parreaux, Cunyuan Gao
1 citations
Parallel Computing and Optimization Techniques
0.49
article

Seamless Scope-Safe Metaprogramming through Polymorphic Subtype Inference (Short Paper)

Lionel Parreaux, Cunyuan Gao
article en
1 citations

Abstract

Practical metaprogramming applications often involve manipulating open code fragments, which is easy to get wrong in the absence of static verification that all variable occurrences remain correctly bound. Many approaches have been proposed to verify the type- and scope-safety of metaprograms, but these approaches are either incomplete or cumbersome, imposing heavy type annotation or proof obligation burdens on metaprogrammers. In this short paper, we propose a new type system to statically keep track of the context requirements of code fragments. Our system uses a novel combination of Boolean-algebraic subtyping and first-class polymorphic type inference techniques to alleviate the annotation burden. The former provides the ability to encode scope requirements as unions of types and the latter allows these types to be locally quantified through a flexible form of polymorphic subtyping. We formalize this type system and demonstrate its implementation in the nascent MLscript functional and object-oriented programming language.

Hong Kong University of Science and Technology (HK)
Life below water, Climate action
Openalex Percentile: Top 36%
Parallel Computing and Optimization Techniques
0.49
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Seamless Scope-Safe Metaprogramming through Polymorphic Subtype Inference (Short Paper) — Lionel Parreaux, Cunyuan Gao · (2024) | TGRS Research Map | TGRS