skip to main content
10.1145/3441296.3441393acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedingsconference-collections
research-article

A type-safe structure editor calculus

Published: 17 January 2021 Publication History

Abstract

Structure editors make syntax errors impossible, but they still allow construction of programs with incomplete semantics, leading to program states that cannot be evaluated. We introduce a structure editor calculus for a simple functional programming language that allows for incomplete programs. Our editor expressions may interleave construction and evaluation of programs and can thus describe the history of the development of a program. We extend our editor calculus with types and define a resource-aware type system that prohibits editor expressions introducing type errors in the abstract syntax tree and prove that the type system is sound.

Supplementary Material

MP4 File (3441296.3441393.mp4)
Video Presentation

References

[1]
Luca Cardelli and Andrew D. Gordon. 2000. Anytime, Anywhere: Modal Logics for Mobile Ambients. In POPL 2000, Proceedings of the 27th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Boston, Massachusetts, USA, January 19-21, 2000, Mark N. Wegman and Thomas W. Reps (Eds.). ACM, 365-377. htps://doi.org/ 10.1145/325694.325742
[2]
Matthias Felleisen and Robert Hieb. 1992. The revised report on the syntactic theories of sequential control and state. Theoretical Computer Science 103, 2 ( 1992 ), 235-271. htps://doi.org/10.1016/ 0304-3975 ( 92 ) 90014-7
[3]
Kohei Honda, Vasco Thudichum Vasconcelos, and Makoto Kubo. 1998. Language primitives and type disciplines for structured communication-based programming. In ESOP'98 (LNCS, Vol. 1381 ). Springer, 22-138.
[4]
Gérard P. Huet. 1997. The Zipper. J. Funct. Program. 7, 5 ( 1997 ), 549-554. htp://journals.cambridge.org/action/displayAbstract?aid= 44121
[5]
Hans Hüttel, Ivan Lanese, Vasco T. Vasconcelos, Luís Caires, Marco Carbone, Pierre-Malo Deniélou, Dimitris Mostrous, Luca Padovani, António Ravara, Emilio Tuosto, Hugo Torres Vieira, and Gianluigi Zavattaro. 2016. Foundations of Session Types and Behavioural Contracts. ACM Comput. Surv. 49, 1 ( 2016 ), 3 : 1-3 : 36. htps://doi.org/10. 1145/2873052
[6]
Cyrus Omar, Ian Voysey, Ravi Chugh, and Matthew A. Hammer. 2019. Live functional programming with typed holes. Proc. ACM Program. Lang. 3, POPL ( 2019 ), 14 : 1-14 : 32. htps://doi.org/10.1145/3290327
[7]
Cyrus Omar, Ian Voysey, Michael Hilton, Jonathan Aldrich, and Matthew A. Hammer. 2017. Hazelnut: a bidirectionally typed structure editor calculus. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, January 18-20, 2017, Giuseppe Castagna and Andrew D. Gordon (Eds.). ACM, 86-99. htp://dl.acm.org/citation.cfm?id= 3009900
[8]
Benjamin C. Pierce. 2002. Types and programming languages. MIT Press. 104-108 pages.
[9]
Jeremy G. Siek and Walid Taha. 2006. Gradual Typing for Functional Languages. In IN SCHEME AND FUNCTIONAL PROGRAMMING WORKSHOP. 81-92.
[10]
Tim Teitelbaum and Thomas Reps. 1981. The Cornell Program Synthesizer: A Syntax-Directed Programming Environment. Commun. ACM 24, 9 (Sept. 1981 ), 563-573. htps://doi.org/10.1145/358746.358755

Cited By

View all
  • (2025)A Type Safe Calculus for Generating Syntax-Directed EditorsProceedings of the 2025 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation10.1145/3704253.3706140(30-42)Online publication date: 10-Jan-2025
  • (2022)A Structure Editor with Type-Safe Copy/PasteProceedings of the 34th Symposium on Implementation and Application of Functional Languages10.1145/3587216.3587221(1-11)Online publication date: 31-Aug-2022
  • (2021)An Editor Calculus With Undo/Redo2021 23rd International Symposium on Symbolic and Numeric Algorithms for Scientific Computing (SYNASC)10.1109/SYNASC54541.2021.00023(66-74)Online publication date: Dec-2021

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PEPM 2021: Proceedings of the 2021 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation
January 2021
89 pages
ISBN:9781450383059
DOI:10.1145/3441296
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 17 January 2021

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. functional programming
  2. structure editors
  3. type systems

Qualifiers

  • Research-article

Conference

POPL '21
Sponsor:

Acceptance Rates

Overall Acceptance Rate 66 of 120 submissions, 55%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)11
  • Downloads (Last 6 weeks)2
Reflects downloads up to 22 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2025)A Type Safe Calculus for Generating Syntax-Directed EditorsProceedings of the 2025 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation10.1145/3704253.3706140(30-42)Online publication date: 10-Jan-2025
  • (2022)A Structure Editor with Type-Safe Copy/PasteProceedings of the 34th Symposium on Implementation and Application of Functional Languages10.1145/3587216.3587221(1-11)Online publication date: 31-Aug-2022
  • (2021)An Editor Calculus With Undo/Redo2021 23rd International Symposium on Symbolic and Numeric Algorithms for Scientific Computing (SYNASC)10.1109/SYNASC54541.2021.00023(66-74)Online publication date: Dec-2021

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media