skip to main content
research-article

Whalesong: running racket in the browser

Published:28 October 2013Publication History
Skip Abstract Section

Abstract

JavaScript is the language of the ubiquitous Web, but it only poorly supports event-driven functional programs due to its single-threaded, asynchronous nature and lack of rich control flow operators. We present Whalesong, a compiler from Racket that generates JavaScript code that masks these problems. We discuss the implementation strategy using delimited continuations, an interface to the DOM, and an FFI for adapting JavaScript libraries to add new platform-dependent reactive features. In the process, we also describe extensions to Racket's functional event-driven programming model. We also briefly discuss the implementation details.

References

  1. H. Abelson and G. J. Sussman. Structure and Interpretation of Computer Programs. MIT Press, second edition, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. P. Achten and R. Plasmeijer. The Ins and Outs of Clean I/O. Journal of Functional Programming, 5, 1995.Google ScholarGoogle Scholar
  3. J. M. Ashley and R. K. Dybvig. An Efficient Implementation of Multiple Return Values in Scheme. In Lisp and Functional Programming, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. B. S. Baker. An Algorithm for Structuring Flowgraphs. Journal of the ACM, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. J. R. Bell. Threaded code. Communications of the ACM, 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. C. F. Bolz, A. Cuni, M. Fijalkowski, and A. Rigo. Tracing the Meta-Level: PyPy's Tracing JIT Compiler. Implementation, Compilation, Optimization of Object Oriented Languages and Programming Systems, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. B. Canou, E. Chailloux, and J. Vouillon. How to run your favorite language in web browsers. In World Wide Web, 2012.Google ScholarGoogle Scholar
  8. J. Clements and M. Felleisen. A tail-recursive machine with stack inspection. In ACM Translations on Programming Languages and Systems, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Felleisen, R. B. Findler, M. Flatt, and S. Krishnamurthi. A Functional I/O System or, Fun for Freshman Kids. International Conference on Functional Programming, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. Felleisen, R. B. Findler, M. Flatt, and S. Krishnamurthi. How to Design Programs. MIT Press, second edition, 2010. www.ccs.neu.edu/home/matthias/HtDP2e/.Google ScholarGoogle Scholar
  11. M. Flatt and PLT. Reference: Racket. Technical Report PLT-TR-2010-1, PLT Inc., 2010. racket-lang.org/tr1/.Google ScholarGoogle Scholar
  12. M. Flatt, G. Yu, R. B. Findler, and M. Felleisen. Adding delimited and composable control to a production programming environment. International Conference on Functional Programming, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. G. Huet. Functional Pearl: The Zipper. Journal of Functional Programming, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. F. Loitsch. Exceptional Continuations in JavaScript. In Scheme and Functional Programming, 2007.Google ScholarGoogle Scholar
  15. L. A. Meyerovich, A. Guha, J. Baskin, G. H. Cooper, M. Greenberg, A. Bromfield, and S. Krishnamurthi. Flapjax: A Programming Language for Ajax Applications. Object-Oriented Programming Systems, Languages, and Applications, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. L. Ramshaw. Eliminating go to's while Preserving Program Structure. Journal of the ACM, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. E. Schanzer, K. Fisler, and S. Krishnamurthi. Bootstrap: Going beyond programming in after-school computer science. In SPLASH Education Symposium, 2013. www.bootstrapworld.org.Google ScholarGoogle Scholar
  18. G. T. Sullivan, D. L. Bruening, I. Baron, T. Garnett, and S. Amarasinghe. Dynamic Native Optimization of Interpreters. Workshop on Interpreters, Virtual Machines, and Emulators, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. A. Yermolovich, C. Wimmer, and M. Franz. Optimization of Dynamic Languages using Hierarchical Layering of Virtual Machines. Dynamic Languages Symposium, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. D. Yoo, E. Schanzer, S. Krishnamurthi, and K. Fisler. WeScheme: The browser is your programming environment. In Conference on Innovation and Technology in Computer Science Education, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Whalesong: running racket in the browser

    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

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 49, Issue 2
      DLS '13
      February 2014
      105 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2578856
      Issue’s Table of Contents
      • cover image ACM Conferences
        DLS '13: Proceedings of the 9th symposium on Dynamic languages
        October 2013
        118 pages
        ISBN:9781450324335
        DOI:10.1145/2508168

      Copyright © 2013 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 28 October 2013

      Check for updates

      Qualifiers

      • research-article

    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!