Modal FRP for all: Haskell中没有空间泄漏的函数式响应式编程

IF 1.1 3区 计算机科学 Q4 COMPUTER SCIENCE, SOFTWARE ENGINEERING
P. Bahr
{"title":"Modal FRP for all: Haskell中没有空间泄漏的函数式响应式编程","authors":"P. Bahr","doi":"10.1017/S0956796822000132","DOIUrl":null,"url":null,"abstract":"Abstract Functional reactive programming (FRP) provides a high-level interface for implementing reactive systems in a declarative manner. However, this high-level interface has to be carefully reigned in to ensure that programs can in fact be executed in practice. Specifically, one must ensure that FRP programs are causal and can be implemented without introducing space leaks. In recent years, modal types have been demonstrated to be an effective tool to ensure these operational properties. In this paper, we present \n$\\mathsf{Rattus}$\n , a modal FRP language that extends and simplifies previous modal FRP calculi while still maintaining the operational guarantees for productivity, causality, and space leaks. The simplified type system makes \n$\\mathsf{Rattus}$\n a practical programming language that can be integrated with existing functional programming languages. To demonstrate this, we have implemented a shallow embedding of \n$\\mathsf{Rattus}$\n in Haskell that allows the programmer to write \n$\\mathsf{Rattus}$\n code in familiar Haskell syntax and seamlessly integrate it with regular Haskell code. Thus, \n$\\mathsf{Rattus}$\n combines the benefits enjoyed by FRP libraries such as Yampa, namely access to a rich library ecosystem (e.g., for graphics programming), with the strong operational guarantees offered by a bespoke type system. To establish the productivity, causality, and memory properties of the language, we prove type soundness using a logical relations argument fully mechanised in the Coq proof assistant.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1000,"publicationDate":"2022-12-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":"{\"title\":\"Modal FRP for all: Functional reactive programming without space leaks in Haskell\",\"authors\":\"P. Bahr\",\"doi\":\"10.1017/S0956796822000132\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Abstract Functional reactive programming (FRP) provides a high-level interface for implementing reactive systems in a declarative manner. However, this high-level interface has to be carefully reigned in to ensure that programs can in fact be executed in practice. Specifically, one must ensure that FRP programs are causal and can be implemented without introducing space leaks. In recent years, modal types have been demonstrated to be an effective tool to ensure these operational properties. In this paper, we present \\n$\\\\mathsf{Rattus}$\\n , a modal FRP language that extends and simplifies previous modal FRP calculi while still maintaining the operational guarantees for productivity, causality, and space leaks. The simplified type system makes \\n$\\\\mathsf{Rattus}$\\n a practical programming language that can be integrated with existing functional programming languages. To demonstrate this, we have implemented a shallow embedding of \\n$\\\\mathsf{Rattus}$\\n in Haskell that allows the programmer to write \\n$\\\\mathsf{Rattus}$\\n code in familiar Haskell syntax and seamlessly integrate it with regular Haskell code. Thus, \\n$\\\\mathsf{Rattus}$\\n combines the benefits enjoyed by FRP libraries such as Yampa, namely access to a rich library ecosystem (e.g., for graphics programming), with the strong operational guarantees offered by a bespoke type system. To establish the productivity, causality, and memory properties of the language, we prove type soundness using a logical relations argument fully mechanised in the Coq proof assistant.\",\"PeriodicalId\":15874,\"journal\":{\"name\":\"Journal of Functional Programming\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":1.1000,\"publicationDate\":\"2022-12-26\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"3\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Journal of Functional Programming\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://doi.org/10.1017/S0956796822000132\",\"RegionNum\":3,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q4\",\"JCRName\":\"COMPUTER SCIENCE, SOFTWARE ENGINEERING\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Functional Programming","FirstCategoryId":"94","ListUrlMain":"https://doi.org/10.1017/S0956796822000132","RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 3

摘要

函数式响应式编程(FRP)为以声明的方式实现响应式系统提供了一个高级接口。但是,必须仔细控制这个高级接口,以确保程序实际上可以在实践中执行。具体来说,必须确保FRP方案是因果关系,并且可以在不引入空间泄漏的情况下实施。近年来,模态类型已被证明是确保这些操作特性的有效工具。在本文中,我们提出了$\mathsf{Rattus}$,这是一种模态FRP语言,它扩展并简化了以前的模态FRP演算,同时仍然保持了对生产率、因果关系和空间泄漏的操作保证。简化的类型系统使$\mathsf{Rattus}$成为一种实用的编程语言,可以与现有的函数式编程语言集成。为了演示这一点,我们在Haskell中实现了$\mathsf{Rattus}$的浅嵌入,允许程序员用熟悉的Haskell语法编写$\mathsf{Rattus}$代码,并将其与常规的Haskell代码无缝集成。因此,$\mathsf{Rattus}$结合了诸如Yampa等FRP库所享有的好处,即访问丰富的库生态系统(例如,用于图形编程),以及定制类型系统提供的强大操作保证。为了建立语言的生产力、因果关系和记忆属性,我们使用Coq证明助手中完全机械化的逻辑关系论证来证明类型合理性。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Modal FRP for all: Functional reactive programming without space leaks in Haskell
Abstract Functional reactive programming (FRP) provides a high-level interface for implementing reactive systems in a declarative manner. However, this high-level interface has to be carefully reigned in to ensure that programs can in fact be executed in practice. Specifically, one must ensure that FRP programs are causal and can be implemented without introducing space leaks. In recent years, modal types have been demonstrated to be an effective tool to ensure these operational properties. In this paper, we present $\mathsf{Rattus}$ , a modal FRP language that extends and simplifies previous modal FRP calculi while still maintaining the operational guarantees for productivity, causality, and space leaks. The simplified type system makes $\mathsf{Rattus}$ a practical programming language that can be integrated with existing functional programming languages. To demonstrate this, we have implemented a shallow embedding of $\mathsf{Rattus}$ in Haskell that allows the programmer to write $\mathsf{Rattus}$ code in familiar Haskell syntax and seamlessly integrate it with regular Haskell code. Thus, $\mathsf{Rattus}$ combines the benefits enjoyed by FRP libraries such as Yampa, namely access to a rich library ecosystem (e.g., for graphics programming), with the strong operational guarantees offered by a bespoke type system. To establish the productivity, causality, and memory properties of the language, we prove type soundness using a logical relations argument fully mechanised in the Coq proof assistant.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
Journal of Functional Programming
Journal of Functional Programming 工程技术-计算机:软件工程
CiteScore
1.70
自引率
0.00%
发文量
9
审稿时长
>12 weeks
期刊介绍: Journal of Functional Programming is the only journal devoted solely to the design, implementation, and application of functional programming languages, spanning the range from mathematical theory to industrial practice. Topics covered include functional languages and extensions, implementation techniques, reasoning and proof, program transformation and synthesis, type systems, type theory, language-based security, memory management, parallelism and applications. The journal is of interest to computer scientists, software engineers, programming language researchers and mathematicians interested in the logical foundations of programming.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信