Scope Graphs: The Story so Far

Authors Aron Zwaan , Hendrik van Antwerpen



PDF
Thumbnail PDF

File

OASIcs.EVCS.2023.32.pdf
  • Filesize: 0.73 MB
  • 13 pages

Document Identifiers

Author Details

Aron Zwaan
  • Delft University of Technology, Netherlands
Hendrik van Antwerpen
  • GitHub, Amsterdam, Netherlands

Acknowledgements

We thank Casper Bach Poulsen, Douglas A. Creager, and the anonymous reviewers for their helpful comments to improve this paper.

Cite AsGet BibTex

Aron Zwaan and Hendrik van Antwerpen. Scope Graphs: The Story so Far. In Eelco Visser Commemorative Symposium (EVCS 2023). Open Access Series in Informatics (OASIcs), Volume 109, pp. 32:1-32:13, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2023)
https://doi.org/10.4230/OASIcs.EVCS.2023.32

Abstract

Static name binding (i.e., associating references with appropriate declarations) is an essential aspect of programming languages. However, it is usually treated in an unprincipled manner, often leaving a gap between formalization and implementation. The scope graph formalism mitigates these deficiencies by providing a well-defined, first-class, language-parametric representation of name binding. Scope graphs serve as a foundation for deriving type checkers from declarative type system specifications, reasoning about type soundness, and implementing editor services and refactorings. In this paper we present an overview of scope graphs, and, using examples, show how the ideas and notation of the formalism have evolved. We also briefly discuss follow-up research beyond type checking, and evaluate the formalism.

Subject Classification

ACM Subject Classification
  • Theory of computation → Program semantics
  • Theory of computation → Program specifications
  • Theory of computation → Program analysis
Keywords
  • scope graph
  • name binding
  • reference resolution
  • type system
  • static semantics

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. Nada Amin, Samuel Grütter, Martin Odersky, Tiark Rompf, and Sandro Stucki. The essence of dependent object types. In Sam Lindley, Conor McBride, Philip W. Trinder, and Donald Sannella, editors, A List of Successes That Can Change the World, volume 9600 of Lecture Notes in Computer Science, pages 249-272. Springer, 2016. URL: https://doi.org/10.1007/978-3-319-30936-1_14.
  2. Martin Bravenboer, Arthur van Dam, Karina Olmos, and Eelco Visser. Program transformation with scoped dynamic rewrite rules. Fundamenta Informaticae, 69(1-2):123-178, 2006. URL: https://content.iospress.com/articles/fundamenta-informaticae/fi69-1-2-06.
  3. Atze Dijkstra and S. Doaitse Swierstra. Ruler: Programming type rules. In 8th International Symposium on Functional and Logic Programming, volume 3945 of Lecture Notes in Computer Science, pages 30-46. Springer, 2006. URL: https://doi.org/10.1007/11737414_4.
  4. Yoshihiko Futamura. Partial computation of programs. In RIMS Symposium on Software Science and Engineering, volume 147 of Lecture Notes in Computer Science, pages 1-35. Springer, 1982. URL: https://doi.org/10.1007/3-540-11980-9_13.
  5. Görel Hedin. Reference attributed grammars. Informatica (Slovenia), 24(3):301-317, 2000. Google Scholar
  6. Zef Hemel, Lennart C. L. Kats, Danny M. Groenewegen, and Eelco Visser. Code generation by model transformation: a case study in transformation modularity. Software and Systems Modeling, 9(3):375-402, 2010. URL: https://doi.org/10.1007/s10270-009-0136-1.
  7. Lennart C. L. Kats and Eelco Visser. The Spoofax language workbench: rules for declarative specification of languages and IDEs. In Proceedings of the 25th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 444-463, Reno/Tahoe, Nevada, 2010. ACM. URL: https://doi.org/10.1145/1869459.1869497.
  8. Gabriël Konat, Lennart C. L. Kats, Guido Wachsmuth, and Eelco Visser. Declarative name binding and scope rules. In Krzysztof Czarnecki and Görel Hedin, editors, 5th International Conference on Software Language Engineering, volume 7745 of Lecture Notes in Computer Science, pages 311-331. Springer, 2012. URL: https://doi.org/10.1007/978-3-642-36089-3_18.
  9. Phil Misteli. Renaming for everyone: Language-parametric renaming in spoofax. Master’s thesis, Delft University of Technology, May 2021. URL: http://resolver.tudelft.nl/uuid:60f5710d-445d-4583-957c-79d6afa45be5.
  10. Pierre Néron, Andrew P. Tolmach, Eelco Visser, and Guido Wachsmuth. A theory of name resolution. In Jan Vitek, editor, Programming Languages and Systems - 24th European Symposium on Programming, ESOP 2015, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2015, London, UK, April 11-18, 2015. Proceedings, volume 9032 of Lecture Notes in Computer Science, pages 205-231. Springer, 2015. URL: https://doi.org/10.1007/978-3-662-46669-8_9.
  11. Daniël A. A. Pelsmaeker, Hendrik van Antwerpen, Casper Bach Poulsen, and Eelco Visser. Language-parametric static semantic code completion. Proceedings of the ACM on Programming Languages, 6(OOPSLA):1-30, 2022. URL: https://doi.org/10.1145/3527329.
  12. Daniël A. A. Pelsmaeker, Hendrik van Antwerpen, and Eelco Visser. Towards language-parametric semantic editor services based on declarative type system specifications (brave new idea paper). In Alastair F. Donaldson, editor, 33rd European Conference on Object-Oriented Programming, volume 134 of LIPIcs. Dagstuhl, 2019. URL: https://doi.org/10.4230/LIPIcs.ECOOP.2019.26.
  13. Benjamin C. Pierce. Types and Programming Languages. MIT Press, Cambridge, Massachusetts, 2002. Google Scholar
  14. Casper Bach Poulsen, Pierre Néron, Andrew P. Tolmach, and Eelco Visser. Scopes describe frames: A uniform model for memory layout in dynamic semantics. In Shriram Krishnamurthi and Benjamin S. Lerner, editors, 30th European Conference on Object-Oriented Programming, ECOOP 2016, July 18-22, 2016, Rome, Italy, volume 56 of LIPIcs. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 2016. URL: https://doi.org/10.4230/LIPIcs.ECOOP.2016.20.
  15. Casper Bach Poulsen, Arjen Rouvoet, Andrew P. Tolmach, Robbert Krebbers, and Eelco Visser. Intrinsically-typed definitional interpreters for imperative languages. Proceedings of the ACM on Programming Languages, 2(POPL), 2018. URL: https://doi.org/10.1145/3158104.
  16. Arjen Rouvoet, Hendrik van Antwerpen, Casper Bach Poulsen, Robbert Krebbers, and Eelco Visser. Knowing when to ask: sound scheduling of name resolution in type checkers derived from declarative specifications. Proceedings of the ACM on Programming Languages, 4(OOPSLA), 2020. URL: https://doi.org/10.1145/3428248.
  17. Hendrik van Antwerpen, Pierre Néron, Andrew P. Tolmach, Eelco Visser, and Guido Wachsmuth. A constraint language for static semantic analysis based on scope graphs. In Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, pages 49-60. ACM, 2016. URL: https://doi.org/10.1145/2847538.2847543.
  18. Hendrik van Antwerpen, Casper Bach Poulsen, Arjen Rouvoet, and Eelco Visser. Scopes as types. Proceedings of the ACM on Programming Languages, 2(OOPSLA), 2018. URL: https://doi.org/10.1145/3276484.
  19. Hendrik van Antwerpen and Eelco Visser. Scope states: Guarding safety of name resolution in parallel type checkers. In Anders Møller and Manu Sridharan, editors, 35th European Conference on Object-Oriented Programming, ECOOP 2021, July 11-17, 2021, Aarhus, Denmark (Virtual Conference), volume 194 of LIPIcs. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2021. URL: https://doi.org/10.4230/LIPIcs.ECOOP.2021.1.
  20. Loek van der Gugten. Function inlining as a language parametric refactoring. Master’s thesis, Delft University of Technology, June 2022. URL: http://resolver.tudelft.nl/uuid:15057a42-f049-4321-b9ee-f62e7f1fda9f.
  21. Vlad A. Vergu, Andrew P. Tolmach, and Eelco Visser. Scopes and frames improve meta-interpreter specialization. In Alastair F. Donaldson, editor, 33rd European Conference on Object-Oriented Programming, ECOOP 2019, July 15-19, 2019, London, United Kingdom, volume 134 of LIPIcs. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2019. URL: https://doi.org/10.4230/LIPIcs.ECOOP.2019.4.
  22. Eelco Visser. A theory of name resolution (blog), January 2015. URL: https://web.archive.org/web/20220925104204/https://eelcovisser.org/blog/writing/2015/01/30/a-theory-of-name-resolution/ [cited 18-01-2023].
  23. Eelco Visser. Understanding software through linguistic abstraction. Science of Computer Programming, 97:11-16, 2015. URL: https://doi.org/10.1016/j.scico.2013.12.001.
  24. Eelco Visser. Fast and safe linguistic abstraction for the masses. In Marieke Huisman, Wouter Swierstra, and Eelco Visser, editors, Tech Report UU-CS-2019-004: A Research Agenda for Formal Methods in the Netherlands, pages 10-11. Department of Information and Computing Sciences, Utrecht University, 2019. Google Scholar
  25. Guido Wachsmuth, Gabriël Konat, Vlad A. Vergu, Danny M. Groenewegen, and Eelco Visser. A language independent task engine for incremental name and type analysis. In Martin Erwig, Richard F. Paige, and Eric Van Wyk, editors, Software Language Engineering - 6th International Conference, SLE 2013, Indianapolis, IN, USA, October 26-28, 2013. Proceedings, volume 8225 of Lecture Notes in Computer Science, pages 260-280. Springer, 2013. URL: https://doi.org/10.1007/978-3-319-02654-1_15.
  26. Aron Zwaan. Composable type system specification using heterogeneous scope graphs. Master’s thesis, Delft University of Technology, January 2021. URL: http://resolver.tudelft.nl/uuid:68b7291c-0f81-4a70-89bb-37624f8615bd.
  27. Aron Zwaan. Specializing scope graph resolution queries. In Proceedings of the 15th ACM SIGPLAN International Conference on Software Language Engineering, SLE 2022, New York, NY, USA, 2022. Association for Computing Machinery. URL: https://doi.org/10.1145/3567512.3567523.
  28. Aron Zwaan, Hendrik van Antwerpen, and Eelco Visser. Incremental type-checking for free: Using scope graphs to derive incremental type-checkers. Proceedings of the ACM on Programming Languages, 6(OOPSLA2), 2022. URL: https://doi.org/10.1145/3563303.
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail