Abstract
Functional Reactive Programming (FRP) is a declarative programming model for constructing interactive applications based on a continuous model of time. FRP programs are described in terms of behaviors (continuous, time-varying, reactive values), and events (conditions that occur at discrete points in time).
This paper presents Frappé, an implementation of FRP in the Java progamming language. The primary contribution of Frappé is its integration of the FRP event/behavior model with the Java Beans event/property model. At the interface level, any Java Beans component may be used as a source or sink for the FRP event and behavior combinators. This provides a mechanism for extending Frappé with new kinds of I/O connections and allows FRP to be used as a high-level declarative model for composing applications from Java Beans components. At the implementation level, the Java Beans event model is used internally by Frappé to propagate FRP events and changes to FRP behaviors. This allows Frappé applications to be packaged as Java Beans components for use in other applications, and yields an implementation of FRP well-suited to the requirements of event-driven applications (such as graphical user interfaces).
This material is based upon work supported under a National Science Foundation Graduate Research Fellowship. Any opinions, findings, conclusions or recommendations expressed in this publication are those of the author and do not necessarily reflect the views of the National Science Foundation.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
G. Bracha, M. Odersky, D. Stoutamire, and P. Wadler. Making the future safe for the past: Adding genericity to the Java programming language. In C. Chambers, editor, Object Oriented Programming: Systems, Languages, and Applications (OOPSLA), ACM SIGPLAN Notices volume 33 number 10, pages 183–200, Vancouver, BC, Oct. 1998.
G. H. (editor). Java Beans API Specification 1.01. Sun Microsystems, 1997. Available online at http://java.sun.com/beans/.
C. Elliott. Functional Implementations of Continuous Modelled Animation. In Proceedings of PLILP/ALP’ 98. Springer-Verlag, 1998.
C. Elliott. An embedded modeling language approach to interactive 3D and multimedia animation. IEEE Transactions on Software Engineering, 25(3):291–308, May/June 1999. Special Section: Domain-Specific Languages (DSL).
C. Elliott. Declarative event-oriented programming. In Proceedings of the 2nd International Conference on Principles and Practice of Declarative Programming (PPDP 2000), September 2000.
C. Elliott and P. Hudak. Functional Reactive Animation. In International Conference on Functional Programming, pages 163–173, June 1997.
S. Finne, D. Leijen, E. Meijer, and S. P. Jones. Calling hell from heaven and heaven from hell. In Proceedings of the Fourth ACM SIGPLAN International Conference on Functional Programming (ICFP’99), volume 34.9 of ACM Sigplan Notices, pages 114–125, N.Y., Sept. 27–29 1999. ACM Press.
S. Finne, D. Leijen, E. Meijer, and S. P. Jones. H/Direct: A binary foreign language interface for haskell. In Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP’ 98), volume 34(1) of ACM SIGPLAN Notices, pages 153–162. ACM, June 1999.
V. J. Hardy. Java 2D API Graphics. P T R Prentice-Hall, Englewood Cliffs, NJ 07632, USA, 1999.
P. Hudak. Modular Domain Specific Languages and Tools. In Proceedings of Fifth International Conference on Software Reuse, pages 134–142, June 1998.
P. Hudak. The Haskell School of Expression-Learning Functional Programming through Multimedia. Cambridge University Press, Cambridge, UK, 2000.
S. P. Jones, E. Meijer, and D. Leijen. Scripting COM components in haskell. In Fifth International Conference on Software Reuse, Victoria, British Columbia, June 1998.
S. Microsystems. Java Core Reflection API and Specification. Sun Microsystems, 1997. Available online at http://java.sun.com/products/jdk/1.3/docs/guide/reflection/index.html.
J. Peterson, C. Elliott, and G. S. Ling. Fran 1.1 Users Manual. Dept. of Computer Science, Yale University, June 1998. Included in Fran distribution available at http://www.research.microsoft.com/ conal/Fran/.
S. Peyton-Jones and J. H. (eds.). Report on the Programming Language Haskell 98: A non-strict, purely functional language. Technical Report YaleU/DCS/RR-1106, Dept. of Computer Science, Yale University, 1999.
M. Sage. FranTk: A Declarative GUI System for Haskell. Dept. of Computer Science, University of Glasgow, 1999. Available at http://www.haskell.org/FranTk/userman.pdf.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Courtney, A. (2001). Frappé: Functional Reactive Programming in Java. In: Ramakrishnan, I.V. (eds) Practical Aspects of Declarative Languages. PADL 2001. Lecture Notes in Computer Science, vol 1990. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45241-9_3
Download citation
DOI: https://doi.org/10.1007/3-540-45241-9_3
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-41768-2
Online ISBN: 978-3-540-45241-6
eBook Packages: Springer Book Archive