Hostname: page-component-586b7cd67f-dlnhk Total loading time: 0 Render date: 2024-12-01T09:08:44.645Z Has data issue: false hasContentIssue false

Dynamic rebinding for marshalling and update, via redex-time and destruct-time reduction

Published online by Cambridge University Press:  17 October 2007

PETER SEWELL
Affiliation:
University of Cambridge (e-mail: [email protected])
GARETH STOYLE
Affiliation:
University of Cambridge (e-mail: [email protected])
MICHAEL HICKS
Affiliation:
University of Maryland, College Park (e-mail: [email protected])
GAVIN BIERMAN
Affiliation:
Microsoft Research, Cambridge (e-mail: [email protected])
KEITH WANSBROUGH
Affiliation:
Data Connection Ltd., Edinburgh (e-mail: [email protected])
Rights & Permissions [Opens in a new window]

Abstract

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.

Most programming languages adopt static binding, but for distributed programming an exclusive reliance on static binding is too restrictive: dynamic binding is required in various guises, for example, when a marshalled value is received from the network, containing identifiers that must be rebound to local resources. Typically, it is provided only by ad hoc mechanisms that lack clean semantics. In this paper, we adopt a foundational approach, developing core dynamic rebinding mechanisms as extensions to the simply typed call-by-value λ calculus. To do so, we must first explore refinements of the call-by-value reduction strategy that delay instantiation, to ensure computations make use of the most recent versions of rebound definitions. We introduce redex-time and destruct-time strategies. The latter forms the basis for a λmarsh calculus that supports dynamic rebinding of marshalled values, while remaining as far as possible statically typed. We sketch an extension of λmarsh with concurrency and communication, giving examples showing how wrappers for encapsulating untrusted code can be expressed. Finally, we show that a high-level semantics for dynamic updating can also be based on the destruct-time strategy, defining a λupdate calculus with simple primitives to provide type-safe updating of running code. We show how the ideas of this simple calculus extend to more real-world, module-level dynamic updating in the style of Erlang. We thereby establish primitives and a common semantic foundation for a variety of real-world dynamic rebinding requirements.

Type
Articles
Copyright
Copyright © Cambridge University Press 2007

References

Abadi, M., Cardelli, L., Curien, P-L. & Lèvy, J-J. (1990) Explicit substitutions. In Proc. 17th POPL, ACM SIGPLAN–SIGACT Symposium on Principles of Programming Languages. pp. 31–46.CrossRefGoogle Scholar
Ajmani, S. (2004) A review of software upgrade techniques for distributed systems. Available at: http://pmg.csail.mit.edu/~ajmani/papers/review.pdf. Accessed Sept 2007.Google Scholar
Ajmani, S., Liskov, B. & Shrira, L. (2006) Modular software upgrades for distributed systems. In Proc. ECOOP, the 20th European Conference on Object-Oriented Programming (Nantes, France), LNCS 4067. New York: Springer, pp. 452476.Google Scholar
Altekar, G., Bagrak, I., Burstein, P. & Schultz, A. (2005 August) OPUS: Online patches and updates for security. In Proceedings of 14th USENIX Security Symposium. USENIX, Berkeley, CA, USA. pp. 287–302.Google Scholar
Ariola, Z. M. & Blom, S. (2002) Skew confluence and the lambda calculus with letrec. Ann. Pure Appl. Logic, 117 (1–3), 97170.CrossRefGoogle Scholar
Ariola, Z. M., Felleisen, M., Maraist, J., Odersky, M. & Wadler, P. (1995 January). A call-by-need lambda calculus. In Proc. 22nd POPL: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (San Francisco. pp. 233–246.CrossRefGoogle Scholar
Armstrong, J., Virding, R., Wikstrom, C. & Williams, M. (1996) Concurrent Programming in Erlang, 2nd ed. Englewood Cliffs, NJ, USA. Prentice Hall.Google Scholar
Barklund, J. & Virding, R. (1999 February) Erlang 4.7.3 reference manual DRAFT (0.7). Available at: http://www.erlang.org/download/erl_spec47.ps.gz. Accessed Sept 2007.Google Scholar
Baumann, A., Appavoo, J., Silva, D. Da, Krieger, O. & Wisniewski, R. (2004 October). Improving operating system availability with dynamic update. In Proceedings of the Workshop on Operating System and Architectural Support for the on demand IT InfraStructure (OASIS) (Boston). pp. 21–27.Google Scholar
Baumann, A., Appavoo, J., Silva, D. Da, Kerr, J., Krieger, O. & Wisniewski, R. W. (2005) Providing dynamic update in an operating system. In Proceedings of the USENIX Annual Technical Conference (Anaheim, CA). USENIX. pp. 279–291.Google Scholar
Bierman, G., Hicks, M., Sewell, P., Stoyle, G. & Wansbrough, K. (2003a August) Dynamic rebinding for marshalling and update, with destruct-time lambda. In Proceedings of ICFP 2003: the 8th ACM SIGPLAN International Conference on Functional Programming (Uppsala). pp. 99–110.CrossRefGoogle Scholar
Bierman, G., Hicks, M., Sewell, P., Stoyle, G. & Wansbrough, K. (2003b June) Dynamic Rebinding for Marshalling and Update, With Destruct-Time λ. Tech. Rept. 568. University of Cambridge Computer Lab. Available at: http://www.cl.cam.ac.uk/~pes20/. Accessed Sept 2007.CrossRefGoogle Scholar
Bierman, G., Hicks, M., Sewell, P. & Stoyle, G. (2003c April). Formalizing dynamic software updating. In Proceedings of USE 2003: The Second International Workshop on Unanticipated Software Evolution (Warsaw).Google Scholar
Billings, J. (2005) A Bytecode Compiler for Acute. Computer Science Tripos Part II Dissertation, University of Cambridge.Google Scholar
Billings, J., Sewell, P., Shinwell, M. & Strniša, R. (2006 September) Type-safe distributed programming for OCaml. In Proc. ML'06, 2006 ACM SIGPLAN Workshop on ML. pp. 20–31.CrossRefGoogle Scholar
Boa. (n.d.) Boa webserver. Available at: http://www.boa.org. Accessed Sept 2007.Google Scholar
Boyapati, C., Liskov, B., Shrira, L., Moh, C.-H. & Richman, S. (2003 October). Lazy modular upgrades in persistent object stores. In Proc. OOPSLA: ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (Anaheim, CA). pp. 403–417.CrossRefGoogle Scholar
Cardelli, L. & Gordon, A. D. (1998) Mobile ambients. In Proc. FoSSaCS: 1st International Conference on Foundations of Software Science and Computation Structure, as part of ETAPS (Lisbon), LNCS 1378. New York: Springer, pp. 140155.Google Scholar
Carlsson, Richard, Gustavsson, Björn, Johannson, Erik, Lindgren, Thomas, Nyström, Svel-Olof, Pettersson, Mikael, & Virding, Robert. 2004 (Nov.). Core Erlang 1.0.3 language specification. http://www.it.uu.se/research/group/hipe/cerl/. Accessed Sept 2007.Google Scholar
Chen, H., Chen, R., Zhang, F., Zang, B. & Yew, P.-C. (2006) Live updating operating systems using virtualization. In Proceedings of VEE: the 2nd International Conference on Virtual Execution Environments (Ottawa). New York: ACM, pp. 3544.CrossRefGoogle Scholar
Chothia, T. & Stark, I. (2000) A distributed pi-calculus with local areas of communication. In Proceedings of HLCL: The 4th International Workshop on High-Level Concurrent Languages (Montreal), published as Electr. Notes Theor. Comput. Sci. 41 (2). pp. 116.Google Scholar
Dami, L. (1998) A lambda-calculus for dynamic binding. Theor. Comput. Sci. 192 (2), 201231.CrossRefGoogle Scholar
dlopen. (n.d.) POSIX dlopen specification. Available at: http://www.opengroup.org/onlinepubs/007904975/functions/dlopen.html Accessed Sept 2007.Google Scholar
Drossopoulou, S. & Eisenbach, S. (2002 June) Manifestations of dynamic linking. In Proceedings of the 1st Workshop on Unanticipated Software Evolution (USE 2002). Available at: http://slurp.doc.ic.ac.uk/pubs/manifestations-use02.pdf. Accessed Sept 2007.Google Scholar
Duggan, D. (2000) Sharing in typed module assembly language. In Proceedings of TIC: The 3rd International Workshop on Types in Compilation (Montreal), Revised Selected Papers, LNCS 2071. New York: Springer, pp. 85116.Google Scholar
Duggan, D. (2001) Type-based hot swapping of running modules. In Proc. 5th ICFP: The ACM SIGPLAN International Conference on Functional Programming (Firenze). pp. 62–73.Google Scholar
Fabry, R. S. (1976) How to design a system in which modules can be changed on the fly. In Proceedings of the International Conference on Software Engineering (ICSE). pp. 470–476.Google Scholar
Felleisen, M. & Friedman, D. P. (1987) Control operators, the SECD-machine, and the lambda calculus. In Formal Description of Programming Concepts III, Wirsing, M. (ed). North-Holland: Elsevier, pp. 193219.Google Scholar
Felleisen, M. & Hieb, R. (1992) The revised report on the syntactic theories of sequential control and state. Theor. Comput. Sci. 103 (2), 235271.CrossRefGoogle Scholar
Felleisen, M., Wand, M., Friedman, D. P. & Duba, B. F. (1988 July) Abstract continuations: A mathematical semantics for handling full functional jumps. In ACM Conference on LISP and Functional Programming (Snowbird, Utah). pp. 52–62.CrossRefGoogle Scholar
Fournet, C., Gonthier, G., Lévy, J-J., Maranget, L. & Rémy, D. (1996) A calculus of mobile agents. In Proceedings of CONCUR '96: The 7th International Conference on Concurrency Theory (Pisa), LNCS 1119. New York: Springer, pp. 406421.Google Scholar
Frieder, O. & Segal, M. E. (1991) On dynamically updating a computer program: From concept to prototype. J. Syst. Software 14 (2), 111128.CrossRefGoogle Scholar
Garrigue, J. (1995) Dynamic binding and lexical binding in a transformation calculus. In Proceedings of the Fuji International Workshop on Functional and Logic Programming. Singapore: World Scientific, 14 pp.Google Scholar
Gilmore, S., Kirli, D. & Walton, C. (1997) Dynamic ML Without Dynamic Types. Tech. Rept. ECS-LFCS-97-378. Dept. of Computer Science, The University of Edinburgh.Google Scholar
Goldberg, A. & Robson, D. (1989) Smalltalk 80–-The Language and Its Implementation. Reading MA: Addison-Wesley.Google Scholar
Gunter, C. A., Rémy, D. & Riecke, J. G. (1995 June) A generalisation of exceptions and control in ML-like languages. In Proceedings of FPCA '95: The ACM SIGPLAN-SIGARCH-WG2.8 Conference on Functional Programming Languages and Computer Architecture (La Jolla, CA). pp. 12–23.CrossRefGoogle Scholar
Gupta, D. (1994 November) On-line Software Version Change, Ph.D. thesis. Kanpur, India: Department of Computer Science and Engineering, Indian Institute of Technology.Google Scholar
Hashimoto, M. & Ohori, A. (2001) A typed context calculus. Theor. Comput. Sci. 266 (1–2), 249272.CrossRefGoogle Scholar
Hashimoto, M. & Yonezawa, A. (2000) MobileML: A programming language for mobile computation. In Proc. COORDINATION (Limassol, Cyprus), LNCS 1906. New York: Springer, pp. 198215.Google Scholar
Hicks, M. (2001 August). Dynamic Software Updating, Ph.D. thesis. Philadelphia: University of Pennsylvania.CrossRefGoogle Scholar
Hicks, M. & Weirich, S. (2000) A Calculus for Dynamic Loading. Tech. Rept. MS-CIS-00-07. Philadelphia: University of Pennsylvania.Google Scholar
Hicks, M., Weirich, S. & Crary, K. (2000) Safe and flexible dynamic linking of native code. In Proceedings of TIC: the 3rd International Workshop on Types in Compilation (Montreal), Revised Selected Papers, LNCS 2071. New York: Springer, pp. 147176.Google Scholar
Hirschowitz, T. (2003) Modules mixins, modules et récursion étendue en appel par valeur, Thèse de doctorat. Université Paris 7.Google Scholar
Hirschowitz, T. Leroy, X. & Wells, J. B. (2003 August) Compilation of extended recursion in call-by-value functional languages. In Proceedings of PPDP: the 5th International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming (Uppsala). pp. 160–171.CrossRefGoogle Scholar
Jagannathan, S. (1994) Metalevel building blocks for modular systems. ACM Trans. Program. Lang. Syst. 16 (3), 456492.CrossRefGoogle Scholar
Java. (n.d.) Java platform debugger architecture. (This supports class replacement). Available at: http://java.sun.com/j2se/1.4.2/docs/guide/jpda/. Accessed Sept 2007.Google Scholar
Kiselyov, O. ChiehShan, C. Shan, C. & Sabry, A. (2006) Delimited dynamic binding. In Proceedings of ICFP: the 11th ACM SIGPLAN International Conference on Functional Programming (Portland, Oregon). pp. 26–37.CrossRefGoogle Scholar
Lee, I. (1983 April) DYMOS: A dynamic modification system. Ph.D. thesis. Madison: Department of Computer Science, University of Wisconsin.Google Scholar
Lee, S-D. & Friedman, D. P. (1993 January) Quasi-static scoping: Sharing variable bindings across multiple lexical scopes. In Proceedings of POPL: The 20th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Charleston). pp. 479–492.CrossRefGoogle Scholar
Leroy, X., Doligez, D., Garrigue, J., Rémy, D. & Vouillon, J. (2001 December) The Objective Caml System Release 3.04 Documentation. Paris: Institut National de Recherche en In formatique et en Automatique.Google Scholar
Lewis, J. R., Launchbury, J., Meijer, E. & Shields, M. (2000 January) Implicit parameters: Dynamic scoping with static types. In Proceedings of POPL: The 27th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Boston). pp. 108–118.CrossRefGoogle Scholar
MIT. (n.d.) MIT Scheme. Available at: http://www.swiss.ai.mit.edu/projects/scheme/. Accessed Sept 2007.Google Scholar
Moreau, L. (1998) A syntactic theory of dynamic binding. Higher-order Symbolic Comput. 11 (3), 233279.CrossRefGoogle Scholar
Moreau, L. & Queinnec, C. (1994) Partial continuations as the difference of continuations: A duumvirate of control operators. In Proc. PLILP: The 6th International Symposium on Programming Language Implementation and Logic Programming (Madrid), LNCS 844. New York: Springer, pp. 182197.CrossRefGoogle Scholar
Neamtiu, I. Hicks, M. Stoyle, G. & Oriol, M. (2006 June) Practical dynamic software updating for C. In Proceedings of PLDI: The ACM Conference on Programming Language Design and Implementation (Ottawa). pp. 72–83.CrossRefGoogle Scholar
Needham, R. M. (1993) Names. In Distributed Systems, Mullender, S. (ed) 2nd ed. Wokingham, England: Addison-Wesley, pp. 315327.Google Scholar
Pai, V. S., Druschel, P. & Zwaenepoel, W. (1999 June) Flash: An efficient and portable webserver. In Proceedings of the USENIX Annual Technical Conference. pp. 106–119.Google Scholar
Peterson, J. Hudak, P. & Ling, G. S. (1997 July) Principled Dynamic Code Improvement. Tech. Rept. YALEU/DCS/RR-1135. New Haven, CT: Department of Computer Science, Yale University.Google Scholar
Potter, S. & Nieh, J. (2005 December) Reducing downtime due to system maintenance and upgrades. In Proceedings of LISA: The 19th Conference on Systems Administration (San Diego). 47–62.Google Scholar
Queinnec, C. (1993) A library of high level control operators. Lisp Pointers ACM SIGPLAN Spec. Interest Publ. Lisp 6 (4), 1126.CrossRefGoogle Scholar
Riely, J. & Hennessy, M. (1999 January). Trust and partial typing in open systems of mobile agents. In Proceedings of POPL: The 26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (San Antonio). pp. 93–104.CrossRefGoogle Scholar
Rouaix, F. (1996) A web navigator with applets in Caml. Comput. Networks ISDN Sys. 28 (7–11), 13651371.CrossRefGoogle Scholar
Schmitt, A. (2002) Safe dynamic binding in the join calculus. In Proceedings of IFIP TCS: IFIP International Conference on Theoretical Computer Science (Montréal). IFIP Conference Proceedings, vol. 223. Norwell, MA: Kluwer, pp. 563575.Google Scholar
Serra, A. Navarro, N. & Cortes, T. (2000) DITools: Application-level support for dynamic extension and flexible composition. In Proc. USENIX Annual Technical Conference. pp. 225–238.Google Scholar
Sewell, P. (1997) On implementations and semantics of a concurrent programming language. In Proceedings of CONCUR 97: Concurrency Theory (Warsaw). LNCS 1243. Berlin: Springer-Verlag, pp. 391405.Google Scholar
Sewell, P. & Vitek, J. (2000) Secure composition of untrusted code: Wrappers and causality types. In Proc. CSFW: The 13th IEEE Computer Security Foundations Workshop (Cambridge). pp. 269–284.CrossRefGoogle Scholar
Sewell, P. Wojciechowski, P. T. & Pierce, B. C. (1999) Location-independent communication for mobile agents: A two-level architecture. In Internet Programming Languages, LNCS 1686. Springer, pp. 131.Google Scholar
Sewell, P. Leifer, J. J., Wansbrough, K. Allen-Williams, M. ZappaNardelli, F. Nardelli, F. Habouzit, P. & Vafeiadis, V. (2004 October) Acute: High-level Programming Language Design for Distributed Computation. Design Rationale and Language Definition. Tech. Rept. UCAM-CL-TR-605. University of Cambridge Computer Laboratory. Also published as INRIA RR-5329. 193 pp.CrossRefGoogle Scholar
Sewell, P. Leifer, J. J., Wansbrough, K. ZappaNardelli, F. Nardelli, F. Allen-Williams, M. Habouzit, P. & Vafeiadis, V. (2007) Acute: High-level programming language design for distributed computation. J. Funct. Programming 17 (4–5), 547612. Invited submission for an ICFP 2005 special issue.CrossRefGoogle Scholar
Soules, C., Appavoo, J., Hui, K., Silva, D. Da, Ganger, G., Krieger, O., Stumm, M., Wisniewski, R., Auslander, M., Ostrowski, M., Rosenburg, B. & Xenidis, J. (2003 June) System support for online reconfiguration. In Proceedings of the USENIX Annual Technical Conference (San Antonio). pp. 141–154.Google Scholar
Squeak. (n.d.) Squeak Smalltalk-80 Programming system. Available at: http://www.squeak.orgGoogle Scholar
Stoyle, G. (2006) A Theory of Dynamic Software Updates, Ph.D. thesis. University of Cambridge.Google Scholar
Stoyle, G. Hicks, M. Bierman, G. Sewell, P. & Neamtiu, I. (2005 January) Mutatis Mutandis: Safe and predictable dynamic software updating. In Proc. POPL 2005: The 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Long Beach). pp. 183–194.CrossRefGoogle Scholar
Vivas Frontana, J. L., (2001 March) Dynamic Binding of Names in Calculi for Mobile Processes, Ph.D. thesis. Stockholm: KTH.Google Scholar
Walker, D., Crary, K. & Morrisett, G. (2000) Typed memory management via static capabilities. ACM Trans. Programming Lang. Syst. 22 (4), 701771.CrossRefGoogle Scholar
Walton, C. (2001) Abstract Machines for Dynamic Computation, Ph.D. thesis. University of Edinburgh. ECS-LFCS-01-425.Google Scholar
Welsh, M. Culler, D. & Brewer, E. (2001 October) SEDA: An architecture for well-conditioned, scalable internet services. In Proceedings of SOSP: The 18th Eighteenth Symposium on Operating Systems Principles (Banff).. pp. 230–243.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.