Higher-Order and Symbolic Computation

, Volume 23, Issue 4, pp 409–431 | Cite as

A multi-tier semantics for Hop

  • Manuel SerranoEmail author
  • Christian Queinnec


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.


Multi-tier language Web programming Semantics 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    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 CrossRefGoogle Scholar
  2. 2.
    Chong, S., Vikram, K., Myers, A.C.: Sif: Enforcing confidentiality and integrity in web applications. In: Proc. 16th USENIX Security (2007) Google Scholar
  3. 3.
    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) Google Scholar
  4. 4.
    Cooper, E., Wadler, P.: The RPC calculus. In: International Conference on Principles and Practice of Declarative Programming, Coimbra, Portugal (2009) Google Scholar
  5. 5.
    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) Google Scholar
  6. 6.
    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) Google Scholar
  7. 7.
    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) Google Scholar
  8. 8.
    Kelsey, R., Clinger, W., Rees, J.: The revised(5) report on the algorithmic language Scheme. Higher-Order and Symbolic Computation 11(1) (1998) Google Scholar
  9. 9.
    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) Google Scholar
  10. 10.
    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) Google Scholar
  11. 11.
    Mikkonen, T., Taivalsaari, A.: Web applications—spaghetti code for the 21st century. Tech. Rep. SMLI TR-2007-166, Sun Microsystems (2007) Google Scholar
  12. 12.
    Murphy, T., Crary, K., Harper, R.: Type-safe distributed programming with ML5. In: Trustworthy Global Computing (2007).
  13. 13.
    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) Google Scholar
  14. 14.
    Queinnec, C.: Continuations and web servers. High.-Order Symb. Comput. 17(4), 277–295 (2004) CrossRefGoogle Scholar
  15. 15.
    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) Google Scholar
  16. 16.
    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) Google Scholar
  17. 17.
    Stoy, J.E.: Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. MIT Press, Cambridge (1977) Google Scholar
  18. 18.
    Taha, W.: A gentle introduction to multi-stage programming. In: Domain-Specific Program Generation. LNCS, vol. 3016. Springer, Berlin (2004). doi: 10.1007/b98156 CrossRefGoogle Scholar
  19. 19.
    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) Google Scholar

Copyright information

© Springer Science+Business Media, LLC 2010

Authors and Affiliations

  1. 1.INRIA/Sophia-AntipolisSophia AntipolisFrance
  2. 2.UPMC/LIP6ParisFrance

Personalised recommendations