skip to main content
article

Rhine: FRP with type-level clocks

Published:17 September 2018Publication History
Skip Abstract Section

Abstract

Processing data at different rates is generally a hard problem in reactive programming. Buffering problems, lags, and concurrency issues often occur. Many of these problems are clock errors, where data at different rates is combined incorrectly. Techniques to avoid clock errors, such as type-level clocks and deterministic scheduling, exist in the field of synchronous programming, but are not implemented in general-purpose languages like Haskell.

Rhine is a clock-safe library for synchronous and asynchronous Functional Reactive Programming (FRP). It separates the aspects of clocking, scheduling and resampling from each other, and ensures clock-safety at the type level. Concurrent communication is encapsulated safely. Diverse reactive subsystems can be combined in a coherent, declarative data-flow framework, while correct interoperability of data at different rates is guaranteed by type-level clocks. This provides a general-purpose framework that simplifies multi-rate FRP systems and can be used for game development, media applications, GUIs and embedded systems, through a flexible API with many reusable components.

References

  1. Heinrich Apfelmus. 2011. Reactive-banana. https://github.com/ HeinrichApfelmus/reactive-banana .Google ScholarGoogle Scholar
  2. Christiaan Baaij, Matthijs Kooijman, Jan Kuper, Arjan Boeijink, and Marco Gerards. 2010. CλaSH: Structural Descriptions of Synchronous Hardware using Haskell. In Proceedings of the 13th EUROMICRO Conference on Digital System Design: Architectures, Methods and Tools . IEEE Computer Society, 714–721. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Albert Benveniste, Paul Le Guernic, and Christian Jacquemot. 1991. Synchronous programming with events and relations: the SIGNAL language and its semantics. Science of computer programming 16, 2 (1991), 103–149. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Stephen Blackheath. 2012. Sodium. https://github.com/SodiumFRP/ sodium .Google ScholarGoogle Scholar
  5. Timothy Bourke and Marc Pouzet. 2013. Zélus: A Synchronous Language with ODEs. In 16th International Conference on Hybrid Systems: Computation and Control (HSCC’13) . Philadelphia, USA, 113–118. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Paul Caspi and Marc Pouzet. 2000. Lucid Synchrone, a functional extension of Lustre . Technical Report. Université Pierre et Marie Curie, Laboratoire LIP6.Google ScholarGoogle Scholar
  7. Koen Claessen and John Hughes. 2000. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In Proceedings of the International Conference on Functional Programming (ICFP 2000) . ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Antony Courtney and Conal Elliott. 2001. Genuinely Functional User Interfaces. In Haskell Workshop. 41–69.Google ScholarGoogle Scholar
  9. Conal Elliott. 1998. Functional implementations of continuous modeled animation. In Principles of Declarative Programming. Springer, 284– 299. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Conal Elliott and Paul Hudak. 1997. Functional Reactive Animation. In Proceedings of the Second ACM SIGPLAN International Conference on Functional Programming (ICFP ’97) . ACM, 263–273. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Conal M Elliott. 2009. Push-pull functional reactive programming. In Proceedings of the 2nd ACM SIGPLAN symposium on Haskell . ACM, 25–36. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Gabriel Gonzalez. 2012. Pipes. https://github.com/Gabriel439/ Haskell-Pipes-Library .Google ScholarGoogle Scholar
  13. Jason Gregory. 2014. Game Engine Architecture, Second Edition (2nd ed.). A. K. Peters, Ltd., Natick, MA, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Nicholas Halbwachs, Paul Caspi, Pascal Raymond, and Daniel Pilaud. 1991. The synchronous data flow programming language LUSTRE. Proc. IEEE 79, 9 (1991), 1305–1320.Google ScholarGoogle Scholar
  15. Joe Hermaszewski. 2016. vector-sized. https://github.com/expipiplus1/ vector-sized .Google ScholarGoogle Scholar
  16. Justin Le. 2015. Auto. https://github.com/mstksg/auto .Google ScholarGoogle Scholar
  17. Paul Le Guernic, Jean-Pierre Talpin, and Jean-Christophe Le Lann. 2003. Polychrony for system design. Journal of Circuits, Systems, and Computers 12, 03 (2003), 261–303.Google ScholarGoogle ScholarCross RefCross Ref
  18. Ben Lippmeier. 2010. Gloss. https://github.com/benl23x5/gloss .Google ScholarGoogle Scholar
  19. Thomas D. C. Little and Arif Ghafoor. 1990. Synchronization and storage models for multimedia objects. IEEE journal on selected areas in communications 8, 3 (1990), 413–427. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Henrik Nilsson, Antony Courtney, and John Peterson. 2002. Functional Reactive Programming, Continued. In Proceedings of the 2002 ACM SIGPLAN Workshop on Haskell (Haskell ’02) . ACM, 51–64. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Gergely Patai. 2011. Efficient and Compositional Higher-order Streams. In Proceedings of the 19th International Conference on Functional and Constraint Logic Programming (WFLP’10) . 137–154. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Ivan Perez. 2017. Back to the Future: Time Travel in FRP. In Proceedings of the 10th ACM SIGPLAN International Symposium on Haskell (Haskell 2017) . ACM, 105–116. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Ivan Perez. 2018. Fault Tolerant Functional Reactive Programming (Functional Pearl). Proceedings of the ACM on Programming Languages 2, ICFP, Article 96 (July 2018), 30 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Ivan Perez, Manuel Bärenz, and Henrik Nilsson. 2016. Functional Reactive Programming, Refactored. In Proceedings of the 9th International Symposium on Haskell (Haskell 2016) . ACM, 33–44. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Ivan Perez and Henrik Nilsson. 2015. Bridging the GUI Gap with Reactive Values and Relations. In Haskell Symposium. 47–58. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Ivan Perez and Henrik Nilsson. 2017. Testing and Debugging Functional Reactive Programming. Proceedings of the ACM on Programming Languages 1, ICFP, Article 2 (Aug. 2017), 27 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Atze van der Ploeg and Koen Claessen. 2015. Practical Principled FRP: Forget the Past, Change the Future, FRPNow!. In Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming (ICFP 2015) . ACM, 302–314. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Basant Rajan and RK Shyamasundar. 2000. Multiclock ESTEREL: A reactive framework for asynchronous design. In Parallel and Distributed Processing Symposium, 2000. IPDPS 2000. Proceedings. 14th International . IEEE, 201–209. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Schell Scivally. 2015. varying. https://github.com/schell/varying .Google ScholarGoogle Scholar
  30. Michael Snoyman. 2011. Conduit. https://github.com/snoyberg/ conduit .Google ScholarGoogle Scholar
  31. Ertugrul Söylemez. 2016. Netwire. https://github.com/esoeylemez/ netwire .Google ScholarGoogle Scholar
  32. Daniel Winograd-Cort and Paul Hudak. 2012. Wormholes: Introducing Effects to FRP. In Proceedings of the 2012 Haskell Symposium (Haskell ’12) . ACM, 91–104. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Rhine: FRP with type-level clocks

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!