Skip to main content

Crossing State Lines: Adapting Object-Oriented Frameworks to Functional Reactive Languages

  • Conference paper
Functional and Logic Programming (FLOPS 2006)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 3945))

Included in the following conference series:

Abstract

Functional reactive programming integrates dynamic dataflow with functional programming to offer an elegant and powerful model for expressing computations over time-varying values. Developing realistic applications, however, requires access to libraries, such as those for GUIs, that are written in mainstream object-oriented languages. Previous work has developed functional reactive interfaces for GUI toolkits but has not provided an account of the principles underlying the implementation strategy.

In this paper, we investigate this problem by studying the adaptation of the object-oriented toolkit MrEd to the functional reactive language FrTime. The heart of this problem is how to communicate state changes between the application and the toolkit’s widget objects. After presenting a basic strategy for adaptation, we discuss abstraction techniques based on mixins and macros that allow us to adapt numerous properties in many widget classes with minimal code duplication. This results in a wrapper for the entire MrEd toolkit in only a few hundred lines of code. We also briefly discuss a spreadsheet developed with the resulting toolkit.

This work is partially supported by NSF grant CCR-0305949.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bachrach, J., Playford, K.: The Java syntactic extender. In: ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages & Applications, pp. 31–42 (2001)

    Google Scholar 

  2. Bracha, G., Cook, W.: Mixin-based inheritance. In: ACM SIGPLAN Conference on Object- Oriented Programming Systems, Languages & Applications, pp. 303–311 (1990)

    Google Scholar 

  3. Cooper, G.H., Krishnamurthi, S.: Embedding dynamic dataflow in a call-by-value language. In: Sestoft, P. (ed.) ESOP 2006. LNCS, vol. 3924, pp. 294–308. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  4. Courtney, A., Elliott, C.: Genuinely functional user interfaces. In: Haskell Workshop (2001)

    Google Scholar 

  5. Eckstein, R., Loy, M., Wood, D.: Java Swing. O’Reilly, Sebastopol (1997)

    Google Scholar 

  6. Elliott, C., Hudak, P.: Functional reactive animation. In: ACM SIGPLAN International Conference on Functional Programming, pp. 263–277 (1997)

    Google Scholar 

  7. Findler, R.B., Clements, J., Flanagan, C., Flatt, M., Krishnamurthi, S., Steckler, P., Felleisen, M.: DrScheme: A programming environment for Scheme. Journal of Functional Programming 12(2), 159–182 (2002)

    Article  MATH  Google Scholar 

  8. Flatt, M., Findler, R.B., Krishnamurthi, S., Felleisen, M.: Programming languages as operating systems (or, Revenge of the Son of the LispMachine). In: ACM SIGPLAN International Conference on Functional Programming, pp. 138–147 (1999)

    Google Scholar 

  9. Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, pp. 171–183 (1998)

    Google Scholar 

  10. Kohlbecker Jr., E.E.: Syntactic Extensions in the Programming Language Lisp. PhD thesis, Indiana University (1986)

    Google Scholar 

  11. Myers, B.A., Giuse, D.A., Dannenberg, R.B., Kosbie, D.S., Pervin, E., Mickish, A., Zanden, B.V., Marchal, P.: Garnet: Comprehensive support for graphical, highly interactive user interfaces. Computer 23(11), 71–85 (1990)

    Article  Google Scholar 

  12. Myers, B.A., McDaniel, R.G., Miller, R.C., Ferrency, A.S., Faulring, A., Kyle, B.D., Mickish, A., Klimovitsk, Doane, P.: The Amulet environment: New models for effective user interface software development. IEEE Transactions on Software Engineering 23(6), 347–365 (1997)

    Article  Google Scholar 

  13. Nilsson, H., Courtney, A., Peterson, J.: Functional reactive programming, continued. In: ACM SIGPLAN Workshop on Haskell, pp. 51–64 (2002)

    Google Scholar 

  14. Sage, M.: FranTk: A declarative GUI language for Haskell. In: ACM SIGPLAN International Conference on Functional Programming, pp. 106–117 (2000)

    Google Scholar 

  15. Schärli, N., Ducasse, S., Nierstrasz, O., Black, A.P.: Traits: Composable units of behavior. In: European Conference on Object-Oriented Programming, pp. 248–274 (2003)

    Google Scholar 

  16. Sheard, T., Jones, S.P.: Template meta-programming for haskell. In: Proceedings of the ACM SIGPLAN workshop on Haskell, pp. 1–16 (2002)

    Google Scholar 

  17. VanHilst, M., Notkin, D.: Using C++ templates to implement role-based designs. In: International Symposium on Object Technologies for Advanced Software, pp. 22–37 (1996)

    Google Scholar 

  18. Weise, D., Crew, R.: Programmable syntax macros. In: ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 156–165 (1993)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ignatoff, D., Cooper, G.H., Krishnamurthi, S. (2006). Crossing State Lines: Adapting Object-Oriented Frameworks to Functional Reactive Languages. In: Hagiya, M., Wadler, P. (eds) Functional and Logic Programming. FLOPS 2006. Lecture Notes in Computer Science, vol 3945. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11737414_18

Download citation

  • DOI: https://doi.org/10.1007/11737414_18

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-33438-5

  • Online ISBN: 978-3-540-33439-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics