Arrows, Robots, and Functional Reactive Programming

Arrows, Robots, and Functional Reactive Programming
复制标题

箭头、机器人和函数式反应式编程

DOI:
10.1007/978-3-540-44833-4_6
复制
发表时间:
2002
期刊:
Proceedings of the 16th ACM SIGPLAN international conference on Functional programming
影响因子:
--
通讯作者:
J. Peterson
J. Peterson
中科院分区:
--
文献类型:
--
作者:
P. Hudak;A. Courtney;H. Nilsson;J. Peterson

文献摘要

被引文献

相似文献

功能反应式编程(Functional reactive programming),简称 FRP,是一种以高级声明方式对混合系统(即包含连续和离散组件组合的系统)进行编程的范例。FRP 的关键思想是连续、时变值和离散事件的时序序列概念。Yampa 是 FRP 的实例化,是一种嵌入 Haskell 的特定领域语言。本文详细介绍了 Yampa,并展示了如何用它来为一种特殊的混合系统编程:移动机器人。由于性能在机器人编程中至关重要,Yampa 使用箭头(monads 的广义)来创建一种具有时间变化值的严谨编程风格,有助于确保不会发生常见的时间和空间泄漏。虽然本书假定读者对物理和微积分有基本的了解,但并不要求读者有机器人方面的经验。虽然我们假定读者对 Haskell 有一定的了解,但也不要求读者对箭头有所了解。本文献给埃德斯格-W-迪克斯特拉(Edsger W. Dijkstra),以纪念他关于数理逻辑是且必须是构建合理计算机程序的基础这一极具影响力的见解。
Functional reactive programming, or FRP, is a paradigm for programming hybrid systems – i.e., systems containing a combination of both continuous and discrete components – in a high-level, declarative way. The key ideas in FRP are its notions of continuous, time-varying values, and time-ordered sequences of discrete events. Yampa is an instantiation of FRP as a domain-specific language embedded in Haskell. This paper describes Yampa in detail, and shows how it can be used to program a particular kind of hybrid system: a mobile robot. Because performance is critical in robotic programming, Yampa uses arrows (a generalization of monads) to create a disciplined style of programming with time-varying values that helps ensure that common kinds of timeand space-leaks do not occur. No previous experience with robots is expected of the reader, although a basic understanding of physics and calculus is assumed. No knowledge of arrows is required either, although we assume a good working knowledge of Haskell. This paper is dedicated in memory of Edsger W. Dijkstra for his influential insight that mathematical logic is and must be the basis for sensible computer program construction.