Abstract
Hop is a multi-tier programming language where the behavior of interacting servers and clients are expressed by a single program. Hop adheres to the standard web programming style where servers elaborate HTML pages containing JavaScript code. This JavaScript code responds locally to user’s interactions but also (following the so-called Ajax style) requests services from remote servers. These services bring back new HTML fragments containing additional JavaScript code replacing or modifying the state of the client.
This paper presents a continuation-based denotational semantics for a sequential subset of Hop. Though restricted to a single server and a single client, this semantics takes into account the key feature of Hop namely that the server elaborates client code to be run in the client’s browser. This new client-code dynamically requests services from the server which, again, elaborate new client code to be run in the client’s browser.
This semantics details the programming model advocated by Hop and provides a sound basis for future studies such as security of web applications and web continuations.
Article PDF
Similar content being viewed by others
Avoid common mistakes on your manuscript.
References
Chong, S., Liu, J., Myers, A.C., Qi, X., Vikram, K., Zheng, L., Zheng, X.: Building secure web applications with automatic partitioning. Commun. ACM 52(2), 79–87 (2009). doi:10.1145/1461928.1461949
Chong, S., Vikram, K., Myers, A.C.: Sif: Enforcing confidentiality and integrity in web applications. In: Proc. 16th USENIX Security (2007)
Cooper, E., Lindley, S., Wadler, P., Yallop, J.: Links: Web programming without tiers. In: 5th International Symposium on Formal Methods for Components and Objects (2006)
Cooper, E., Wadler, P.: The RPC calculus. In: International Conference on Principles and Practice of Declarative Programming, Coimbra, Portugal (2009)
Cooper, G., Krishnamurthi, S.: Embedding dynamic dataflow in a call-by-value language. In: Proceedings of the European Symposium on Programming (ESOP’06), pp. 194–308 (2006)
Ganz, S.E., Sabry, A., Taha, W.: Macros as multi-stage computations: Type-safe, generative, binding macros in macroml. In: International Conference on Functional Programming (ICFP’01), pp. 74–85. ACM Press (2001)
Jim, T., Swammy, N., Hicks, M.: Defeating script injection attacks with browser-enforced embedded policies. In: 16th International World Wide Web Conference (WWW 2007) (2007)
Kelsey, R., Clinger, W., Rees, J.: The revised(5) report on the algorithmic language Scheme. Higher-Order and Symbolic Computation 11(1) (1998)
Loitsch, F., Serrano, M.: Hop client-side compilation. In: Morazán, M.T. (ed.) Trends in Functional Programming, vol. 8, pp. 141–158. Intellect, Bristol (2008)
Meyerovich, L., Guha, A., Baskin, J., Cooper, G., Greenberg, M., Bromfield, A., Krishnamurthi, S.: Flapjax: A programming language for Ajax applications. In: Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages & Applications (OOPSLA’09). Orlando, FL, USA (2009)
Mikkonen, T., Taivalsaari, A.: Web applications—spaghetti code for the 21st century. Tech. Rep. SMLI TR-2007-166, Sun Microsystems (2007)
Murphy, T., Crary, K., Harper, R.: Type-safe distributed programming with ML5. In: Trustworthy Global Computing (2007). http://tom7.org/papers
Neubauer, M., Thiemann, P.: From sequential programs to multi-tier applications by program transformation. In: Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’05), pp. 221–232. ACM, New York (2005)
Queinnec, C.: Continuations and web servers. High.-Order Symb. Comput. 17(4), 277–295 (2004)
Serrano, M.: HOP, a fast server for the diffuse web. In: Proceedings of the 11th International Conference on Coordination Models and Languages (COORDINATION’09, Lisbon, Portugal). LNCS, vol. 5521. Springer, Berlin (2009)
Serrano, M., Gallesio, E., Loitsch, F.: HOP, a language for programming the Web 2.0. In: Proceedings of the First Dynamic Languages Symposium. Portland, Oregon, USA (2006)
Stoy, J.E.: Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. MIT Press, Cambridge (1977)
Taha, W.: A gentle introduction to multi-stage programming. In: Domain-Specific Program Generation. LNCS, vol. 3016. Springer, Berlin (2004). doi:10.1007/b98156
Yang, F., et al.: A unified platform for data driven web applications with automatic client-server partitioning. In: 16th International World Wide Web Conference (WWW’07), pp. 341–350. Alberta, Canada (2007)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Serrano, M., Queinnec, C. A multi-tier semantics for Hop. Higher-Order Symb Comput 23, 409–431 (2010). https://doi.org/10.1007/s10990-010-9061-9
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10990-010-9061-9