Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3406088.3409016acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Scripted signal functions

Published: 09 August 2020 Publication History

Abstract

Programming time-dependent signals like animations involves expressing both continuous and discrete changes in signal values. The method of functional reactive programming (FRP) represents this simply and effectively as discrete modes of an otherwise continuous signal. In variants of FRP based on arrows, programs are composed not of signals but rather functions on signals. Accordingly, these signal functions can switch between discrete modes of operation. However, the literature emphasizes expressions of mode switching that are unnecessarily limited. An analysis of their limitations indicates the need for two new, primitive transformations of signal functions. These transformations help to define a monad that represents signal function modes, and this allows programmers to express switching in an imperative, script-like style. This scripting interface gains flexibility and power from several novel operations, including a general-purpose mapping between modes and a combination that mixes two concurrent modes into one. We demonstrate its usefulness with several examples.

Supplemental Material

MP4 File
Presentation Videos

References

[1]
Manuel Bärenz and Ivan Perez. Rhine: FRP with type-level clocks. In Proceedings of the 11th ACM SIGPLAN International Symposium on Haskell, Haskell 2018, page 145-157, New York, NY, USA, 2018. Association for Computing Machinery.
[2]
Albert Benveniste and Gérard Berry. The synchronous approach to reactive and real-time systems. Proceedings of the IEEE, 79 ( 9 ): 1270-1282, 1991.
[3]
Gregory Bollella and James Gosling. The real-time specification for Java. Computer, 33 ( 6 ): 47-54, 2000.
[4]
Antony Courtney and Henrik Nilsson. Yampa: library for programming hybrid systems [source code]. htps://hackage.haskell. org/ package/Yampa-0.9.1.1, 2003. Retrieved March 2020.
[5]
Antony Courtney, Henrik Nilsson, and John Peterson. The Yampa arcade. In Proceedings of the 2003 ACM SIGPLAN Workshop on Haskell, Haskell '03, page 7-18, New York, NY, USA, 2003. Association for Computing Machinery.
[6]
Thijs Jefry de Haas, Tim Laue, and Thomas Röfer. A scripting-based approach to robot behavior engineering using hierarchical generators. In 2012 IEEE International Conference on Robotics and Automation, pages 4736-4741. IEEE, 2012.
[7]
Angela Di Febbraro, Davide Giglio, and Nicola Sacco. Urban trafic control structure based on hybrid Petri nets. IEEE Transactions on Intelligent Transportation Systems, 5 ( 4 ): 224-237, 2004.
[8]
Conal Elliott and Paul Hudak. Functional reactive animation. In Proceedings of the Second ACM SIGPLAN International Conference on Functional Programming, ICFP '97, page 263-273, New York, NY, USA, 1997. Association for Computing Machinery.
[9]
Keheliya Gallaba, Ali Mesbah, and Ivan Beschastnikh. Don't call us, we'll call you: Characterizing callbacks in JavaScript. In 2015 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM), pages 1-10. IEEE, 2015.
[10]
Diego Garcés. Scripting language survey. Game Programming Gems, 6 ( 2006 ): 323-340, 2006.
[11]
George Giorgidze and Henrik Nilsson. Switched-on Yampa. In International Symposium on Practical Aspects of Declarative Languages, pages 282-298. Springer, 2008.
[12]
Rafal Goebel, Ricardo G Sanfelice, and Andrew R Teel. Hybrid dynamical systems. IEEE Control Systems Magazine, 29 ( 2 ): 28-93, 2009.
[13]
Gregory D Hager and John Peterson. Frob: A transformational approach to the design of robot software. In Robotics Research, pages 257-264. Springer, 2000.
[14]
John Hughes. Generalising monads to arrows. Science of Computer Programming, 37 ( 1 ): 67-111, 2000.
[15]
Mike McShafry and David Graham. Game Coding Complete. Course Technology, Boston, 2013.
[16]
Pieter J Mosterman and Gautam Biswas. A theory of discontinuities in physical system models. Journal of the Franklin Institute, 335 ( 3 ): 401-439, 1998.
[17]
Henrik Nilsson, Antony Courtney, and John Peterson. Functional reactive programming, continued. In Proceedings of the 2002 ACM SIGPLAN Workshop on Haskell, Haskell '02, page 51-64, New York, NY, USA, 2002. Association for Computing Machinery.
[18]
John K Ousterhout. Scripting : Higher level programming for the 21st century. Computer, 31 ( 3 ): 23-30, 1998.
[19]
Ross Paterson. A new notation for arrows. In Proceedings of the Sixth ACM SIGPLAN International Conference on Functional Programming, ICFP '01, page 229-240, New York, NY, USA, 2001. Association for Computing Machinery.
[20]
Izzet Pembeci, Henrik Nilsson, and Gregory Hager. Functional reactive robotics: An exercise in principled integration of domain-specific languages. In Proceedings of the 4th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, PPDP '02, page 168-179, New York, NY, USA, 2002. Association for Computing Machinery.
[21]
Ivan Perez, Manuel Bärenz, and Henrik Nilsson. Functional reactive programming, refactored. In Proceedings of the 9th International Symposium on Haskell, Haskell 2016, page 33-44, New York, NY, USA, 2016. Association for Computing Machinery.
[22]
John Peterson and Greg Hager. Monadic robotics. In Proceedings of the 2nd conference on Domain-specific languages, pages 95-108, 1999.
[23]
John Peterson, Paul Hudak, and Conal Elliott. Lambda in motion: Controlling robots with Haskell. In Proceedings of the First International Workshop on Practical Aspects of Declarative Languages, PADL '99, page 91-105, Berlin, Heidelberg, 1999. Springer-Verlag.
[24]
Miro Samek. Who moved my state? Dr. Dobb's Journal, April 2003.

Cited By

View all
  • (2023)The Essence of ReactivityProceedings of the 16th ACM SIGPLAN International Haskell Symposium10.1145/3609026.3609727(18-31)Online publication date: 30-Aug-2023

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
Haskell 2020: Proceedings of the 13th ACM SIGPLAN International Symposium on Haskell
August 2020
150 pages
ISBN:9781450380508
DOI:10.1145/3406088
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 09 August 2020

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Haskell
  2. functional reactive programming

Qualifiers

  • Research-article

Conference

ICFP '20
Sponsor:

Acceptance Rates

Overall Acceptance Rate 57 of 143 submissions, 40%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)8
  • Downloads (Last 6 weeks)0
Reflects downloads up to 20 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2023)The Essence of ReactivityProceedings of the 16th ACM SIGPLAN International Haskell Symposium10.1145/3609026.3609727(18-31)Online publication date: 30-Aug-2023

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media