Using Spoofax to Support Online Code Navigation

Author Peter D. Mosses



PDF
Thumbnail PDF

File

OASIcs.EVCS.2023.21.pdf
  • Filesize: 2.26 MB
  • 12 pages

Document Identifiers

Author Details

Peter D. Mosses
  • Delft University of Technology, The Netherlands
  • Swansea University, UK

Acknowledgements

Eelco Visser (1966–2022) was a visionary leader. For more than two decades, I have benefited greatly from reading his persuasive publications, listening to his animated presentations, and discussing topics of common interest with him - especially modular language specification. Since 2012, I have also been an enthusiastic user of the Spoofax language workbench, developed by Eelco and his Programming Languages group at TU Delft. This paper reports on some work that I carried out as a visitor at TU Delft since 2016. I am grateful to the reviewers of a previous version for helpful comments and suggestions.

Cite AsGet BibTex

Peter D. Mosses. Using Spoofax to Support Online Code Navigation. In Eelco Visser Commemorative Symposium (EVCS 2023). Open Access Series in Informatics (OASIcs), Volume 109, pp. 21:1-21:12, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2023)
https://doi.org/10.4230/OASIcs.EVCS.2023.21

Abstract

Spoofax is a language workbench. A Spoofax language specification generally includes name resolution: the analysis of bindings between definitions and references. When browsing code in the specified language using Spoofax, the bindings appear as hyperlinks, supporting precise name-based code navigation. However, Spoofax cannot be used for browsing code in online repositories. This paper is about a toolchain that uses Spoofax to generate hyperlinked twins of code repositories. These generated artefacts support the same precise code navigation as Spoofax, and can be browsed online. The technique has been prototyped on the CBS (Component-Based Semantics) specification language developed by the PLanCompS project, but could be used on any language after specifying its name resolution in Spoofax.

Subject Classification

ACM Subject Classification
  • Information systems → Web interfaces
  • Software and its engineering → Integrated and visual development environments
  • Software and its engineering → Development frameworks and environments
Keywords
  • Spoofax language workbench
  • name resolution
  • precise code navigation

Metrics

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

References

  1. CBS-beta. A framework and meta-language for component-based specification of programming languages, accessed 2023-01-30. URL: https://plancomps.github.io/CBS-beta/.
  2. CBS-LaTeX. A LaTeX package for CBS specifications, accessed 2023-01-30. URL: https://plancomps.github.io/cbs-latex/.
  3. Martin Churchill, Peter D. Mosses, Neil Sculthorpe, and Paolo Torrini. Reusable components of semantic specifications. LNCS Trans. Aspect Oriented Softw. Dev., 12:132-179, 2015. URL: https://doi.org/10.1007/978-3-662-46734-3_4.
  4. Douglas Creager. Introducing stack graphs. GitHub Blog, 2021. URL: https://github.blog/2021-12-09-introducing-stack-graphs/.
  5. Damian Frölich and L. Thomas van Binsbergen. iCoLa: A compositional meta-language with support for incremental language development. In Bernd Fischer, Lola Burgueño, and Walter Cazzola, editors, Proceedings of the 15th ACM SIGPLAN International Conference on Software Language Engineering, SLE 2022, Auckland, New Zealand, December 6-7, 2022, pages 202-215. ACM, 2022. URL: https://doi.org/10.1145/3567512.3567529.
  6. Jekyll. A static site generator, accessed 2023-01-30. URL: https://jekyllrb.com.
  7. KaTeX. A math typesetting library for the web, accessed 2023-01-30. URL: https://katex.org/.
  8. Lennart C. L. Kats and Eelco Visser. The Spoofax language workbench. In William R. Cook, Siobhán Clarke, and Martin C. Rinard, editors, Companion to the 25th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2010, October 17-21, 2010, Reno/Tahoe, Nevada, USA, pages 237-238. ACM, 2010. URL: https://doi.org/10.1145/1869542.1869592.
  9. Casey Klein, John Clements, Christos Dimoulas, Carl Eastlund, Matthias Felleisen, Matthew Flatt, Jay A. McCarthy, Jon Rafkind, Sam Tobin-Hochstadt, and Robert Bruce Findler. Run your research: on the effectiveness of lightweight mechanization. In John Field and Michael Hicks, editors, Proceedings of the 39th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2012, Philadelphia, Pennsylvania, USA, January 22-28, 2012, pages 285-296. ACM, 2012. URL: https://doi.org/10.1145/2103656.2103691.
  10. Gabriël Konat, Sebastian Erdweg, and Eelco Visser. Bootstrapping domain-specific meta-languages in language workbenches. In Bernd Fischer and Ina Schaefer, editors, Proceedings of the 2016 ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences, GPCE 2016, Amsterdam, The Netherlands, October 31 - November 1, 2016, pages 47-58. ACM, 2016. URL: https://doi.org/10.1145/2993236.2993242.
  11. Gabriël D. P. Konat, Lennart C. L. Kats, Guido Wachsmuth, and Eelco Visser. Declarative name binding and scope rules. In Krzysztof Czarnecki and Görel Hedin, editors, Software Language Engineering, 5th International Conference, SLE 2012, Dresden, Germany, September 26-28, 2012, Revised Selected Papers, 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.
  12. kramdown. A library for parsing and converting a superset of Markdown, accessed 2023-01-30. URL: https://kramdown.gettalong.org.
  13. MathJax. A JavaScript display engine for mathematics, accessed 2023-01-30. URL: https://mathjax.org/.
  14. MetaBorg. GitHub organisation, accessed 2023-01-30. URL: https://github.com/metaborg.
  15. Peter D. Mosses. Modular structural operational semantics. J. Log. Algebraic Methods Program., 60-61:195-228, 2004. URL: https://doi.org/10.1016/j.jlap.2004.03.008.
  16. Peter D. Mosses. A component-based formal language workbench. In Rosemary Monahan, Virgile Prevosto, and José Proença, editors, Proceedings Fifth Workshop on Formal Integrated Development Environment, F-IDE@FM 2019, Porto, Portugal, 7th October 2019, volume 310 of EPTCS, pages 29-34, 2019. URL: https://doi.org/10.4204/EPTCS.310.4.
  17. Peter D. Mosses. Software meta-language engineering and CBS. J. Comput. Lang., 50:39-48, 2019. URL: https://doi.org/10.1016/j.jvlc.2018.11.003.
  18. Peter D. Mosses. Fundamental constructs in programming languages. In Tiziana Margaria and Bernhard Steffen, editors, Leveraging Applications of Formal Methods, Verification and Validation - 10th International Symposium on Leveraging Applications of Formal Methods, ISoLA 2021, Rhodes, Greece, October 17-29, 2021, Proceedings, volume 13036 of Lecture Notes in Computer Science, pages 296-321. Springer, 2021. URL: https://doi.org/10.1007/978-3-030-89159-6_19.
  19. Pierre Neron, 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, 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.
  20. Daniël A. A. Pelsmaeker, Hendrik van Antwerpen, and Eelco Visser. Towards language-parametric semantic editor services based on declarative type system specifications. 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, pages 26:1-26:18. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2019. URL: https://doi.org/10.4230/LIPIcs.ECOOP.2019.26.
  21. PLanCompS: Programming language components and specifications. Home page, accessed 2023-01-30. URL: https://plancomps.github.io.
  22. 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. Proc. ACM Program. Lang., 4(OOPSLA):180:1-180:28, 2020. URL: https://doi.org/10.1145/3428248.
  23. SCIP Code Intelligence Protocol. Sourcegraph Blog post, accessed 2023-01-30. URL: https://about.sourcegraph.com/blog/announcing-scip.
  24. spoofax-sunshine. An application for running Spoofax, accessed 2023-01-30. URL: https://github.com/metaborg/spoofax-sunshine.
  25. Hendrik van Antwerpen, Pierre Neron, Andrew P. Tolmach, Eelco Visser, and Guido Wachsmuth. A constraint language for static semantic analysis based on scope graphs. In Martin Erwig and Tiark Rompf, editors, Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM 2016, St. Petersburg, FL, USA, January 20 - 22, 2016, pages 49-60. ACM, 2016. URL: https://doi.org/10.1145/2847538.2847543.
  26. Hendrik van Antwerpen, Casper Bach Poulsen, Arjen Rouvoet, and Eelco Visser. Scopes as types. Proc. ACM Program. Lang., 2(OOPSLA):114:1-114:30, 2018. URL: https://doi.org/10.1145/3276484.
  27. 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, volume 194 of LIPIcs, pages 1:1-1:29. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2021. URL: https://doi.org/10.4230/LIPIcs.ECOOP.2021.1.
  28. L. Thomas van Binsbergen, Peter D. Mosses, and Neil Sculthorpe. Executable component-based semantics. J. Log. Algebraic Methods Program., 103:184-212, 2019. URL: https://doi.org/10.1016/j.jlamp.2018.12.004.
  29. L. Thomas van Binsbergen, Neil Sculthorpe, and Peter D. Mosses. Tool support for component-based semantics. In Lidia Fuentes, Don S. Batory, and Krzysztof Czarnecki, editors, Companion Proceedings of the 15th International Conference on Modularity, Málaga, Spain, March 14 - 18, 2016, pages 8-11. ACM, 2016. URL: https://doi.org/10.1145/2892664.2893464.
  30. Visual Studio Code: Language server extension guide. Visual Studio Code API, accessed 2023-01-30. URL: https://code.visualstudio.com/api/language-extensions/language-server-extension-guide.
  31. Guido Wachsmuth, Gabriël D. P. Konat, and Eelco Visser. Language design with the Spoofax language workbench. IEEE Softw., 31(5):35-43, 2014. URL: https://doi.org/10.1109/MS.2014.100.
  32. Philip Wadler, Wen Kokke, and Jeremy G. Siek. Programming Language Foundations in Agda. Online book, August 2022. URL: https://plfa.inf.ed.ac.uk/22.08/.
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