Skip to main content
Log in

A multi-tier semantics for Hop

  • Published:
Higher-Order and Symbolic Computation

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.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  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

    Article  Google Scholar 

  2. Chong, S., Vikram, K., Myers, A.C.: Sif: Enforcing confidentiality and integrity in web applications. In: Proc. 16th USENIX Security (2007)

  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)

  4. Cooper, E., Wadler, P.: The RPC calculus. In: International Conference on Principles and Practice of Declarative Programming, Coimbra, Portugal (2009)

  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)

  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)

  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)

  8. Kelsey, R., Clinger, W., Rees, J.: The revised(5) report on the algorithmic language Scheme. Higher-Order and Symbolic Computation 11(1) (1998)

  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. 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)

  11. Mikkonen, T., Taivalsaari, A.: Web applications—spaghetti code for the 21st century. Tech. Rep. SMLI TR-2007-166, Sun Microsystems (2007)

  12. Murphy, T., Crary, K., Harper, R.: Type-safe distributed programming with ML5. In: Trustworthy Global Computing (2007). http://tom7.org/papers

  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. Queinnec, C.: Continuations and web servers. High.-Order Symb. Comput. 17(4), 277–295 (2004)

    Article  Google Scholar 

  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. 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)

  17. Stoy, J.E.: Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. MIT Press, Cambridge (1977)

    Google Scholar 

  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

    Chapter  Google Scholar 

  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)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Manuel Serrano.

Rights and permissions

Reprints 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

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10990-010-9061-9

Keywords

Navigation