Abstract
Many programming languages allow programmers to regulate accessibility; i.e., annotating a declaration with keywords such as export and private to indicate where it can be accessed. Despite the importance of name accessibility for, e.g., compilers, editor auto-completion and tooling, and automated refactorings, few existing type systems provide a formal account of name accessibility. We present a declarative, executable, and language-parametric model for name accessibility, which provides a formal specification of name accessibility in Java, C#, C++, Rust, and Eiffel. We achieve this by defining name accessibility as a predicate on resolution paths through scope graphs. Since scope graphs are a language-independent model of name resolution, our model provides a uniform approach to defining different accessibility policies for different languages. Our model is implemented in Statix, a logic language for executable type system specification using scope graphs. We evaluate its correctness on a test suite that compares it with the C#, Java, and Rust compilers, and show we can synthesize access modifiers in programs with holes accurately.
| Original language | English |
|---|---|
| Title of host publication | 38th European Conference on Object-Oriented Programming (ECOOP 2024) |
| Editors | Jonathan Aldrich, Guido Salvaneschi |
| Place of Publication | Wadern |
| Publisher | Schloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing |
| Number of pages | 29 |
| ISBN (Electronic) | 978-3-95977-341-6 |
| DOIs | |
| Publication status | Published - 2024 |
| Event | 38th European Conference on Object-Oriented Programming - Vienna University of Technology, Vienna, Austria Duration: 16 Sept 2024 → 20 Sept 2024 https://2024.ecoop.org/ |
Publication series
| Name | Leibniz International Proceedings in Informatics, LIPIcs |
|---|---|
| Volume | 313 |
| ISSN (Print) | 1868-8969 |
Conference
| Conference | 38th European Conference on Object-Oriented Programming |
|---|---|
| Abbreviated title | ECOOP 2024 |
| Country/Territory | Austria |
| City | Vienna |
| Period | 16/09/24 → 20/09/24 |
| Internet address |
Keywords
- access modifier
- name resolution
- scope graph
- visibility