Hazelnut: A Bidirectionally Typed Structure Editor Calculus
Structure editors allow programmers to edit the tree structure of a program directly. This can have cognitive benefits, particularly for novice and end-user programmers. It also simplifies matters for tool designers, because they do not need to contend with malformed program text. This paper defines...
Saved in:
Published in | arXiv.org |
---|---|
Main Authors | , , , , |
Format | Paper Journal Article |
Language | English |
Published |
Ithaca
Cornell University Library, arXiv.org
04.02.2019
|
Subjects | |
Online Access | Get full text |
Cover
Loading…
Abstract | Structure editors allow programmers to edit the tree structure of a program directly. This can have cognitive benefits, particularly for novice and end-user programmers. It also simplifies matters for tool designers, because they do not need to contend with malformed program text. This paper defines Hazelnut, a structure editor based on a small bidirectionally typed lambda calculus extended with holes and a cursor. Hazelnut goes one step beyond syntactic well-formedness: its edit actions operate over statically meaningful incomplete terms. Naively, this would force the programmer to construct terms in a rigid "outside-in" manner. To avoid this problem, the action semantics automatically places terms assigned a type that is inconsistent with the expected type inside a hole. This safely defers the type consistency check until the term inside the hole is finished. Hazelnut is a foundational type-theoretic account of typed structure editing, rather than an end-user tool itself. To that end, we describe how Hazelnut's rich metatheory, which we have mechanized in Agda, guides the definition of an extension to the calculus. We also discuss various plausible evaluation strategies for terms with holes, and in so doing reveal connections with gradual typing and contextual modal type theory, the Curry-Howard interpretation of contextual modal logic. Finally, we discuss how Hazelnut's semantics lends itself to implementation as a functional reactive program. Our reference implementation is written using js_of_ocaml. |
---|---|
AbstractList | Structure editors allow programmers to edit the tree structure of a program directly. This can have cognitive benefits, particularly for novice and end-user programmers. It also simplifies matters for tool designers, because they do not need to contend with malformed program text. This paper defines Hazelnut, a structure editor based on a small bidirectionally typed lambda calculus extended with holes and a cursor. Hazelnut goes one step beyond syntactic well-formedness: its edit actions operate over statically meaningful incomplete terms. Naively, this would force the programmer to construct terms in a rigid "outside-in" manner. To avoid this problem, the action semantics automatically places terms assigned a type that is inconsistent with the expected type inside a hole. This safely defers the type consistency check until the term inside the hole is finished. Hazelnut is a foundational type-theoretic account of typed structure editing, rather than an end-user tool itself. To that end, we describe how Hazelnut's rich metatheory, which we have mechanized in Agda, guides the definition of an extension to the calculus. We also discuss various plausible evaluation strategies for terms with holes, and in so doing reveal connections with gradual typing and contextual modal type theory, the Curry-Howard interpretation of contextual modal logic. Finally, we discuss how Hazelnut's semantics lends itself to implementation as a functional reactive program. Our reference implementation is written using js_of_ocaml. Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages (POPL 2017) Structure editors allow programmers to edit the tree structure of a program directly. This can have cognitive benefits, particularly for novice and end-user programmers. It also simplifies matters for tool designers, because they do not need to contend with malformed program text. This paper defines Hazelnut, a structure editor based on a small bidirectionally typed lambda calculus extended with holes and a cursor. Hazelnut goes one step beyond syntactic well-formedness: its edit actions operate over statically meaningful incomplete terms. Naively, this would force the programmer to construct terms in a rigid "outside-in" manner. To avoid this problem, the action semantics automatically places terms assigned a type that is inconsistent with the expected type inside a hole. This safely defers the type consistency check until the term inside the hole is finished. Hazelnut is a foundational type-theoretic account of typed structure editing, rather than an end-user tool itself. To that end, we describe how Hazelnut's rich metatheory, which we have mechanized in Agda, guides the definition of an extension to the calculus. We also discuss various plausible evaluation strategies for terms with holes, and in so doing reveal connections with gradual typing and contextual modal type theory, the Curry-Howard interpretation of contextual modal logic. Finally, we discuss how Hazelnut's semantics lends itself to implementation as a functional reactive program. Our reference implementation is written using js_of_ocaml. |
Author | Hammer, Matthew A Voysey, Ian Omar, Cyrus Aldrich, Jonathan Hilton, Michael |
Author_xml | – sequence: 1 givenname: Cyrus surname: Omar fullname: Omar, Cyrus – sequence: 2 givenname: Ian surname: Voysey fullname: Voysey, Ian – sequence: 3 givenname: Michael surname: Hilton fullname: Hilton, Michael – sequence: 4 givenname: Jonathan surname: Aldrich fullname: Aldrich, Jonathan – sequence: 5 givenname: Matthew surname: Hammer middlename: A fullname: Hammer, Matthew A |
BackLink | https://doi.org/10.1145/3093333.3009900$$DView published paper (Access to full text may be restricted) https://doi.org/10.48550/arXiv.1607.04180$$DView paper in arXiv |
BookMark | eNotj1FLwzAUhYMoOOd-gE8WfG69yU3SVJ9mmU4Y-GDfS9amkBHbmjZi_fXWzacDh4_D-a7Iedu1hpAbCglXQsC99t_2K6ES0gQ4VXBGFgyRxoozdklWw3AAACZTJgQuyONW_xjXhvEhWkdPtrbeVKPtWu3cFBVTb-roffShGoM30aa2Y-ejXLsquDBck4tGu8Gs_nNJiudNkW_j3dvLa77exVowjGtZs0ozBC6Z0CgzrlABCkF5XWVNM5-hyLTam7luMpNJMGnGkOMegUqDS3J7mj2alb23H9pP5Z9heTScibsT0fvuM5hhLA9d8LPDUDJQkFEUHPEXU6BTEw |
ContentType | Paper Journal Article |
Copyright | 2019. This work is published under http://arxiv.org/licenses/nonexclusive-distrib/1.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License. http://arxiv.org/licenses/nonexclusive-distrib/1.0 |
Copyright_xml | – notice: 2019. This work is published under http://arxiv.org/licenses/nonexclusive-distrib/1.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License. – notice: http://arxiv.org/licenses/nonexclusive-distrib/1.0 |
DBID | 8FE 8FG ABJCF ABUWG AFKRA AZQEC BENPR BGLVJ CCPQU DWQXO HCIFZ L6V M7S PIMPY PQEST PQQKQ PQUKI PRINS PTHSS AKY GOX |
DOI | 10.48550/arxiv.1607.04180 |
DatabaseName | ProQuest SciTech Collection ProQuest Technology Collection Materials Science & Engineering Collection ProQuest Central (Alumni) ProQuest Central ProQuest Central Essentials AUTh Library subscriptions: ProQuest Central Technology Collection ProQuest One Community College ProQuest Central SciTech Premium Collection (Proquest) (PQ_SDU_P3) ProQuest Engineering Collection ProQuest Engineering Database Publicly Available Content Database ProQuest One Academic Eastern Edition (DO NOT USE) ProQuest One Academic ProQuest One Academic UKI Edition ProQuest Central China Engineering Collection arXiv Computer Science arXiv.org |
DatabaseTitle | Publicly Available Content Database Engineering Database Technology Collection ProQuest Central Essentials ProQuest One Academic Eastern Edition ProQuest Central (Alumni Edition) SciTech Premium Collection ProQuest One Community College ProQuest Technology Collection ProQuest SciTech Collection ProQuest Central China ProQuest Central ProQuest Engineering Collection ProQuest One Academic UKI Edition ProQuest Central Korea Materials Science & Engineering Collection ProQuest One Academic Engineering Collection |
DatabaseTitleList | Publicly Available Content Database |
Database_xml | – sequence: 1 dbid: GOX name: arXiv.org url: http://arxiv.org/find sourceTypes: Open Access Repository – sequence: 2 dbid: 8FG name: ProQuest Technology Collection url: https://search.proquest.com/technologycollection1 sourceTypes: Aggregation Database |
DeliveryMethod | fulltext_linktorsrc |
Discipline | Physics |
EISSN | 2331-8422 |
ExternalDocumentID | 1607_04180 |
Genre | Working Paper/Pre-Print |
GroupedDBID | 8FE 8FG ABJCF ABUWG AFKRA ALMA_UNASSIGNED_HOLDINGS AZQEC BENPR BGLVJ CCPQU DWQXO FRJ HCIFZ L6V M7S M~E PIMPY PQEST PQQKQ PQUKI PRINS PTHSS AKY GOX |
ID | FETCH-LOGICAL-a523-d6d2ca2304625a3694838035514dc9ff002132a8be380f9e960e792343b3016e3 |
IEDL.DBID | GOX |
IngestDate | Mon Jan 08 05:43:29 EST 2024 Thu Oct 10 16:44:16 EDT 2024 |
IsDoiOpenAccess | true |
IsOpenAccess | true |
IsPeerReviewed | false |
IsScholarly | false |
Language | English |
LinkModel | DirectLink |
MergedId | FETCHMERGED-LOGICAL-a523-d6d2ca2304625a3694838035514dc9ff002132a8be380f9e960e792343b3016e3 |
OpenAccessLink | https://arxiv.org/abs/1607.04180 |
PQID | 2080913543 |
PQPubID | 2050157 |
ParticipantIDs | arxiv_primary_1607_04180 proquest_journals_2080913543 |
PublicationCentury | 2000 |
PublicationDate | 20190204 |
PublicationDateYYYYMMDD | 2019-02-04 |
PublicationDate_xml | – month: 02 year: 2019 text: 20190204 day: 04 |
PublicationDecade | 2010 |
PublicationPlace | Ithaca |
PublicationPlace_xml | – name: Ithaca |
PublicationTitle | arXiv.org |
PublicationYear | 2019 |
Publisher | Cornell University Library, arXiv.org |
Publisher_xml | – name: Cornell University Library, arXiv.org |
SSID | ssj0002672553 |
Score | 1.7233139 |
SecondaryResourceType | preprint |
Snippet | Structure editors allow programmers to edit the tree structure of a program directly. This can have cognitive benefits, particularly for novice and end-user... Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages (POPL 2017) Structure editors allow programmers to edit the tree structure... |
SourceID | arxiv proquest |
SourceType | Open Access Repository Aggregation Database |
SubjectTerms | Calculus Computer Science - Programming Languages Hazelnuts Programmers Semantics |
SummonAdditionalLinks | – databaseName: ProQuest Technology Collection dbid: 8FG link: http://utb.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwfV1LSwMxEB60RfDmk1ar5OB1tZtkX3oQLa1FUAQr9LZkkywUyrbdbUX99c6kWz0IXrOnzGYe3zfDNwAXmudBgsHXy7iOEKAIRUMAmRdY4wsd-sZa6ug-PYfDN_k4DsY14VbVY5WbmOgCtZlp4sgRpMckYRlIcTtfeLQ1irqr9QqNbWj6PIoIfMWDhx-OhYcRVsxi3cx00l1XqvyYvBOlEl12pU9ikE139CcUu_wy2IPmi5rbch-2bHEAO24sU1eHcDNUX3ZarJbX7I7dT9b5x5F3009GENKwVycAuyot6xv0zpL11JQoveoIRoP-qDf06nUHnkI06JnQcK2Io0VIokSYyFjEXUEVjdFJnlM2FlzFmcXjPLEIPSyJ_0mRoZOGVhxDo5gVtgUsQT_UJhcCsYjkPMuM1Fxq9M1AB7kUbWi5S6fztaJFSvZInT3a0NnYIa1fc5X-2v7k_8-nsIsFReKmmmUHGmgBe4ZJe5mduz_zDff9lFI priority: 102 providerName: ProQuest |
Title | Hazelnut: A Bidirectionally Typed Structure Editor Calculus |
URI | https://www.proquest.com/docview/2080913543 https://arxiv.org/abs/1607.04180 |
hasFullText | 1 |
inHoldings | 1 |
isFullTextHit | |
isPrint | |
link | http://utb.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwdV09T8MwED21ZWFBIEAtlMoDa6CxnRDD1FZpK6QWBEXqFvkrUqUqoH4gYOC3c3ZSMSAWD5Y9-JzzvXc-vwBcappHAg_fQFF9gwSFSVcEoILImpDpODTWuhvdyTQev_D7eTSvAdm9hZGrj8V7qQ-s1tdO_eyqy8MESXmdUleyNXqYl5eTXoqrGv87DjGm7_pztPp4MTyEgwrokV65M0dQs8Ux3I3ll10W280t6ZH-oownPhm3_CSOEhry7AVdtytLUoPetiIDuXQpuvUJzIbpbDAOqt8XBBLZXWBiQ7V0OVekGJLFgics6TKHUIwWee6iK6MyURa7c2GRSlgn5seZQqeLLTuFRvFa2CYQgX6lTc4YcgtOqVKGa8o1-lqko5yzFjT9orO3UqEic_bIvD1a0N7ZIau-znVGESaKkEWcnf0_8xz2ERwIX6HM29DA1dsLDMAb1YF6Mhx1YK-fTh-fOn5PsJ18pz_Cs4dm |
link.rule.ids | 228,230,783,787,888,12777,21400,27937,33385,33756,43612,43817 |
linkProvider | Cornell University |
linkToHtml | http://utb.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwfV1NT8JAEN0ojdGbnxFF3YPXKuxuS6sHIwRSFQhRTLg1291tQkIKtmDUX-_MUvRg4nV72unOx3szeUPIpWKpF0LwdROmmgBQuMQhgMT1jG5w5Te0MdjR7Q_86FU8jr1xSbgV5VjlOibaQK1nCjlyAOkBSlh6gt_N31zcGoXd1XKFxiZxUKoKwJfT6gyGzz8sC_ObUDPzVTvTinddy_xj8o6kSvOqLhooB-nYoz_B2GaY7i5xhnJu8j2yYbJ9smUHM1VxQG4j-WWm2XJxQ-9pa7LKQJa-m35SBJGavlgJ2GVuaEeDf-a0LadI6hWHZNTtjNqRWy48cCXgQVf7mimJLC2AEsn9UAQ8qHOsabQK0xTzMWcySAwcp6EB8GFQ_k_wBNzUN_yIVLJZZo4JDcETlU45BzQiGEsSLRQTCrzTU14qeJUc20vH85WmRYz2iK09qqS2tkNcvuci_rX-yf-fL8h2NOr34t7D4OmU7EB5EdoZZ1EjFbCGOYMUvkjOy__0DbJBmKM |
openUrl | ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.atitle=Hazelnut%3A+A+Bidirectionally+Typed+Structure+Editor+Calculus&rft.jtitle=arXiv.org&rft.au=Omar%2C+Cyrus&rft.au=Voysey%2C+Ian&rft.au=Hilton%2C+Michael&rft.au=Aldrich%2C+Jonathan&rft.date=2019-02-04&rft.pub=Cornell+University+Library%2C+arXiv.org&rft.eissn=2331-8422&rft_id=info:doi/10.48550%2Farxiv.1607.04180 |