Reasonably programmable literal notation

Author:

Omar Cyrus1,Aldrich Jonathan2

Affiliation:

1. University of Chicago, USA

2. Carnegie Mellon University, USA

Abstract

General-purpose programming languages typically define literal notation for only a small number of common data structures, like lists. This is unsatisfying because there are many other data structures for which literal notation might be useful, e.g. finite maps, regular expressions, HTML elements, SQL queries, syntax trees for various languages and chemical structures. There may also be different implementations of each of these data structures behind a common interface that could all benefit from common literal notation. This paper introduces typed literal macros (TLMs) , which allow library providers to define new literal notation of nearly arbitrary design at any specified type or parameterized family of types. Compared to existing approaches, TLMs are uniquely reasonable . TLM clients can reason abstractly, i.e. without examining grammars or generated expansions, about types and binding. The system only needs to convey to clients, via secondary notation, the inferred segmentation of each literal body, which gives the locations and types of spliced subterms. TLM providers can reason modularly about syntactic ambiguity and expansion correctness according to clear criteria. This paper incorporates TLMs into Reason, an emerging alternative front-end for OCaml, and demonstrates, through several non-trivial case studies, how TLMs integrate with the advanced features of OCaml, including pattern matching and the module system. We also discuss optional integration with MetaOCaml, which allows TLM providers to be more confident about type correctness. Finally, we establish these abstract reasoning principles formally with a detailed type-theoretic account of expression and pattern TLMs for “core ML”.

Funder

National Security Agency

Defense Advanced Research Projects Agency

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference82 articles.

1. Michael D. Adams. 2015. Towards the Essence of Hygiene. In POPL. 10.1145/2676726.2677013 Michael D. Adams. 2015. Towards the Essence of Hygiene. In POPL. 10.1145/2676726.2677013

2. Eric Anderson Gilman D Veith and David Weininger. 1987. SMILES a line notation and computerized interpreter for chemical structures. US Environmental Protection Agency Environmental Research Laboratory. Eric Anderson Gilman D Veith and David Weininger. 1987. SMILES a line notation and computerized interpreter for chemical structures. US Environmental Protection Agency Environmental Research Laboratory.

3. Markup.ml — Error-recovering streaming HTML5 and XML parsers for OCaml. http://aantron.github. io/markup.ml/;Bachin Anton;Retrieved Mar.,2018

4. Alan Bawden. 1999. Quasiquotation in Lisp. In Partial Evaluation and Semantic-Based Program Manipulation. http: //repository.readscheme.org/ftp/papers/pepm99/bawden.pdf Alan Bawden. 1999. Quasiquotation in Lisp. In Partial Evaluation and Semantic-Based Program Manipulation. http: //repository.readscheme.org/ftp/papers/pepm99/bawden.pdf

5. Frédéric Bour Thomas Refis and Gabriel Scherer. 2018. Experience report: Merlin a Language Server for OCaml. In ICFP. Frédéric Bour Thomas Refis and Gabriel Scherer. 2018. Experience report: Merlin a Language Server for OCaml. In ICFP.

Cited by 5 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Lorgnette: Creating Malleable Code Projections;Proceedings of the 36th Annual ACM Symposium on User Interface Software and Technology;2023-10-29

2. Rhombus: A New Spin on Macros without All the Parentheses;Proceedings of the ACM on Programming Languages;2023-10-16

3. Contextualized Programming Language Documentation;Proceedings of the 2022 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software;2022-11-29

4. Notational Programming for Notebook Environments: A Case Study with Quantum Circuits;The 35th Annual ACM Symposium on User Interface Software and Technology;2022-10-28

5. Filling typed holes with live GUIs;Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation;2021-06-18

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3