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.
- H. Abelson and G. J. Sussman. Structure and Interpretation of Computer Programs. MIT Press, second edition, 1996. Google Scholar
Digital Library
- P. Achten and R. Plasmeijer. The Ins and Outs of Clean I/O. Journal of Functional Programming, 5, 1995.Google Scholar
- J. M. Ashley and R. K. Dybvig. An Efficient Implementation of Multiple Return Values in Scheme. In Lisp and Functional Programming, 1994. Google Scholar
Digital Library
- B. S. Baker. An Algorithm for Structuring Flowgraphs. Journal of the ACM, 1977. Google Scholar
Digital Library
- J. R. Bell. Threaded code. Communications of the ACM, 1973. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- B. Canou, E. Chailloux, and J. Vouillon. How to run your favorite language in web browsers. In World Wide Web, 2012.Google Scholar
- J. Clements and M. Felleisen. A tail-recursive machine with stack inspection. In ACM Translations on Programming Languages and Systems, 2004. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- M. Flatt and PLT. Reference: Racket. Technical Report PLT-TR-2010-1, PLT Inc., 2010. racket-lang.org/tr1/.Google Scholar
- 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 Scholar
Digital Library
- G. Huet. Functional Pearl: The Zipper. Journal of Functional Programming, 1997. Google Scholar
Digital Library
- F. Loitsch. Exceptional Continuations in JavaScript. In Scheme and Functional Programming, 2007.Google Scholar
- 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 Scholar
Digital Library
- L. Ramshaw. Eliminating go to's while Preserving Program Structure. Journal of the ACM, 1988. Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- A. Yermolovich, C. Wimmer, and M. Franz. Optimization of Dynamic Languages using Hierarchical Layering of Virtual Machines. Dynamic Languages Symposium, 2009. Google Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Whalesong: running racket in the browser
Recommendations
Whalesong: running racket in the browser
DLS '13: Proceedings of the 9th symposium on Dynamic languagesJavaScript 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 ...
Doppio: breaking the browser language barrier
PLDI '14Web browsers have become a de facto universal operating system, and JavaScript its instruction set. Unfortunately, running other languages in the browser is not generally possible. Translation to JavaScript is not enough because browsers are a hostile ...
Pycket: a tracing JIT for a functional language
ICFP '15We present Pycket, a high-performance tracing JIT compiler for Racket. Pycket supports a wide variety of the sophisticated features in Racket such as contracts, continuations, classes, structures, dynamic binding, and more. On average, over a standard ...







Comments