Functional reactive programming (FRP) is a declarative programming paradigm for implementing reactive programs at a high level of abstraction. It applies functional programming principles to construct and manipulate time-varying values, also known as signals. However, for this programming paradigm to work in practice, an FRP language must ensure that programs are causal, productive, and free of space leaks. Over the past fifteen years, several modal type systems to enforce these operational properties have been developed. We present a new FRP language with a significantly simplified modal type system that imposes fewer restrictions than previous modal FRP languages while still guaranteeing the central operational properties of causality, productivity, and absence of space leaks. The key enabling idea is to alter the semantics of signals so that the type system can safely allow more programs to type-check, thereby making the language more expressive, too. With this new semantics, signals are modelled as mutable references whose mutability is tightly controlled by the 'later' type modality. This disciplined form of mutability also enables more efficient in-place updates of signals, all while preserving a functional programming style.


翻译:函数式响应式编程(FRP)是一种声明式编程范式,用于在高层抽象级别实现响应式程序。它应用函数式编程原则来构建和操作随时间变化的值(也称为信号)。然而,为了使该编程范式在实践中可行,FRP语言必须确保程序具有因果性、生产性且无空间泄漏。过去十五年间,已开发出多种用于强制执行这些操作属性的模态类型系统。我们提出了一种新的FRP语言,其模态类型系统显著简化,比先前的模态FRP语言施加更少的限制,同时仍能保证因果性、生产性及无空间泄漏等核心操作属性。其关键实现思路是改变信号的语义,使得类型系统能够安全地允许更多程序通过类型检查,从而也增强了语言的表达能力。在这种新语义下,信号被建模为可变引用,其可变性受到“later”类型模态的严格约束。这种受控的可变形式还支持对信号进行更高效的原位更新,同时保持了函数式编程风格。

0
下载
关闭预览

相关内容

人们为了让计算机解决各种棘手的问题,使用编程语言 编写程序代码并通过计算机运算得到最终结果的过程。
大语言模型表示工程的分类、机会与挑战
专知会员服务
22+阅读 · 2025年2月28日
《面向基础模型的高效参数微调》综述
专知会员服务
33+阅读 · 2025年1月24日
【新书】使用Python进行金融建模
专知会员服务
33+阅读 · 2024年9月28日
多模态预训练模型综述
专知会员服务
94+阅读 · 2023年11月20日
使用多模态语言模型生成图像
专知会员服务
32+阅读 · 2023年8月23日
【Manning新书】面向数据编程降低软件复杂度,426页pdf
专知会员服务
88+阅读 · 2022年9月5日
多模态预训练模型简述
专知会员服务
115+阅读 · 2021年4月27日
专知会员服务
149+阅读 · 2020年9月6日
激活函数还是有一点意思的!
计算机视觉战队
12+阅读 · 2019年6月28日
基于模型系统的系统设计
科技导报
10+阅读 · 2019年4月25日
这可能是「多模态机器学习」最通俗易懂的介绍
计算机视觉life
113+阅读 · 2018年12月20日
各种相似性度量及Python实现
机器学习算法与Python学习
11+阅读 · 2017年7月6日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
Arxiv
0+阅读 · 3月5日
VIP会员
最新内容
《新兴技术武器化及其对全球风险的影响》
专知会员服务
8+阅读 · 4月29日
《帕兰泰尔平台介绍:信息分析平台》
专知会员服务
19+阅读 · 4月29日
智能体化世界建模:基础、能力、规律及展望
专知会员服务
11+阅读 · 4月28日
相关VIP内容
大语言模型表示工程的分类、机会与挑战
专知会员服务
22+阅读 · 2025年2月28日
《面向基础模型的高效参数微调》综述
专知会员服务
33+阅读 · 2025年1月24日
【新书】使用Python进行金融建模
专知会员服务
33+阅读 · 2024年9月28日
多模态预训练模型综述
专知会员服务
94+阅读 · 2023年11月20日
使用多模态语言模型生成图像
专知会员服务
32+阅读 · 2023年8月23日
【Manning新书】面向数据编程降低软件复杂度,426页pdf
专知会员服务
88+阅读 · 2022年9月5日
多模态预训练模型简述
专知会员服务
115+阅读 · 2021年4月27日
专知会员服务
149+阅读 · 2020年9月6日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员