Hostname: page-component-848d4c4894-8kt4b Total loading time: 0 Render date: 2024-06-21T19:08:45.076Z Has data issue: false hasContentIssue false

A theory of RPC calculi for client–server model

Published online by Cambridge University Press:  22 March 2019

Chonnam National University, Gwangju, Republic of Korea (e-mail:
Sookmyung Women’s University, Seoul, Republic of Korea (e-mail:
Rights & Permissions [Opens in a new window]


Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

With multi-tier programming languages, programmers can specify the locations of code to run in order to reduce development efforts for the web-based client–server model where programmers write client and server programs separately and test the multiple programs together. The RPC calculus, one of the foundations of those languages by Cooper and Wadler, has the feature of symmetric communication in programmer’s writing arbitrarily deep nested client–server interactions. The feature of the calculus is fully implemented by asymmetric communication in trampolined style suitable for the client–server model. However, the existing research only considers a stateless server strategy in which all server states are encoded for transmission to the client so that server states do not need to be stored in the server. It cannot always correctly handle all stateful operations involving disks or databases. To resolve this problem, we first propose new stateful calculi that fully support both symmetric communication from the programmer’s viewpoint and asymmetric communication in its implementation using trampolined style. All the existing calculi either provide only the feature of asymmetric communication or propose only symmetric implementation suitable for the peer-to-peer model, rather than the client–server model. Second, the method used to design our stateful server strategy is based on a new locative type system which paves the way for a theory of RPC calculi for the client–server model. Besides proposing the new stateful calculi, this theory can improve the existing stateless server strategy to construct new state-encoding calculi that eliminate runtime checks on remote procedure calls present in the existing strategy, and it enables us to design a new mixed strategy that combines the benefits of both kinds of strategies. As far as we know, there are no typed multi-tier calculi that offer programmers the feature of symmetric communication with the implementation of asymmetric communication under the three strategies together.

Regular Paper
© Cambridge University Press 2019 


Balat, V. (2006) Ocsigen: Typing web interaction with Objective Caml. In ML’06: Proceedings of the 2006 Workshop on ML, pp. 8494.Google Scholar
Boudol, G., Luo, Z., Rezk, T. & Serrano, M. (2012) Reasoning about web applications: An operational semantics for HOP. ACM Trans. Program. Lang. Syst. 34(2), 10:110:40.Google Scholar
Chlipala, A. (2015) Ur/Web: A simple model for programming the web. In POPL’15: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 153165.CrossRefGoogle Scholar
Conway, M. E. (1963) Design of a separable transition-diagram compiler. Commun. ACM 6(7), 396408.CrossRefGoogle Scholar
Cooper, E. K. & Wadler, P. (2009) The RPC calculus. In PPDP’09: Proceedings of the 11th ACM SIGPLAN Conference on Principles and Practice of Declarative Programming. New York, NY, USA: ACM, pp. 231242.CrossRefGoogle Scholar
Cooper, E. K., Lindley, S., Wadler, P. & Yallop, J. (2007) Links: Web programming without tiers. In FMCO’06: Proceedings of the 5th International Conference on Formal Methods for Components and Objects. Berlin, Heidelberg: Springer-Verlag, pp. 266296.CrossRefGoogle Scholar
Flanagan, C., Sabry, A., Duba, B. F. & Felleisen, M. (1993) The essence of compiling with continuations. In PLDI’93: Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. New York, NY, USA: ACM, pp. 237247.CrossRefGoogle Scholar
Ganz, S. E., Friedman, D. P. & Wand, M. (1999) Trampolined style. In ICFP’99: Proceedings of the Fourth ACM SIGPLAN International Conference on Functional Programming. New York, NY, USA: ACM, pp. 1827.Google Scholar
Gay, S. J. & Hole, M. (1999) Types and subtypes for client–server interactions. In ESOP’99: Proceedings of the 8th European Symposium on Programming Languages and Systems. London, UK, UK: Springer-Verlag, pp. 7490.CrossRefGoogle Scholar
Graunke, P., Findler, R. B., Krishnamurthi, S. & Felleisen, M. (2001) Automatically restructuring programs for the web. In ASE’01: Proceedings of the 16th IEEE International Conference on Automated Software Engineering. Washington, DC, USA: IEEE Computer Society, pp. 211222.CrossRefGoogle Scholar
Krishnamurthi, S., Hopkins, P. W., McCarthy, J., Graunke, P., Pettyjohn, G. & Felleisen, M. (2007) Implementation and use of the PLT scheme web server. Higher-Order Symb. Comput. 20(4), 431460.Google Scholar
Launchbury, J. & Peyton Jones, S. L. (1994) Lazy functional state threads. In PLDI’94: Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. Orlando, Florida, USA, pp. 2435.Google Scholar
Matthews, J., Findler, R. B., Graunke, P., Krishnamurthi, S. & Felleisen, M. (2004). Automatically restructuring programs for the web. Autom. Softw. Eng. 11(4), 337364.CrossRefGoogle Scholar
McCarthy, J. A. (2009) Automatically restful web applications: Marking modular serializable continuations. In ICFP’09: Proceedings of the 14th ACM SIGPLAN International Conference on Functional Programming. New York, NY, USA: ACM, pp. 299310.CrossRefGoogle Scholar
McCarthy, J. A. (2010) The two-state solution: Native and serializable continuations accord. In OOPSLA’10: Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications. New York, NY, USA: ACM, pp. 567582.Google Scholar
Murphy VII, T. (2008) Modal Types for Mobile Code. Ph.D. thesis, Carnegie Mellon University, Pittsburgh, PA, USA.Google Scholar
Murphy VII, T., Cray, K., Harper, R. & Pfenning, F. (2004) A symmetric modal lambda calculus for distributed computing. In LICS’04: Proceedings of the 19th Annual IEEE Symposium on Logic in Computer Science. Washington, DC, USA: IEEE Computer Society, pp. 286295.Google Scholar
Neubauer, M. & Thiemann, P. (2005) From sequential programs to multi-tier applications by program transformation. In POPL’05: Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. New York, NY, USA: ACM, pp. 221232.Google Scholar
Queinnec, C. (2004) Continuations and web servers. Higher-Order Symb. Comput. 17(4), 277295.CrossRefGoogle Scholar
Radanne, G. (2017) Tierless Web Programming in ML. Ph.D. thesis, University Paris Diderot.CrossRefGoogle Scholar
Rastogi, A., Hammer, M. A. & Hicks, M. (2014) Wysteria: A programming language for generic, mixed-mode multiparty computations. In SP’14: Proceedings of the 2014 IEEE Symposium on Security and Privacy. Washington, DC, USA: IEEE Computer Society, pp. 655670.CrossRefGoogle Scholar
Reynders, B., Devriese, D. & Piessens, F. (2014) Multi-tier functional reactive programming for the web. In Onward!’14: Proceedings of the 2014 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software, pp. 5568.Google Scholar
Reynolds, J. C. (1972) Definitional interpreters for higher-order programming languages. In ACM’72: Proceedings of the ACM Annual Conference - Volume 2. New York, NY, USA: ACM, pp. 717740.CrossRefGoogle Scholar
Serrano, M. & Berry, G. (2012) Multi-tier programming in Hop. Commun. ACM 55(8), 5359.Google Scholar
Serrano, M. & Prunet, V. (2016) A glimpse of Hopjs. In ICFP’16: Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming, pp. 180192.Google Scholar
Serrano, M. & Queinnec, C. (2010) A multi-tier semantics for Hop. Higher-order Symb. Comput. 23(4), 409431.CrossRefGoogle Scholar
Serrano, M., Gallesio, E. & Loitsch, F. (2006) Hop: A language for programming the web 2.0. In DLS’06: Proceedings of the 1st Dynamic Languages Symposium, pp. 975985.Google Scholar
Timany, A., Stefanesco, L., Krogh-Jespersen, M. & Birkedal, L. (2017) A logical relation for monadic encapsulation of state: Proving contextual equivalences in the presence of runST. In PACMPL’17: Proceedings of ACM Programming Languages, 2(POPL), pp. 64:1–64:28.Google Scholar

Choi and Chang supplementary material

Choi and Chang supplementary material

Download Choi and Chang supplementary material(Video)
Video 40.5 MB
Submit a response


No Discussions have been published for this article.