Global abstraction-safe marshalling with hash types

Type abstraction is a key feature of ML-like languages for writing large programs. Marshalling is necessary for writing distributed programs, exchanging values via network byte-streams or persistent stores. In this paper we combine the two, developing compile-time and run-time semantics for marshalling, that guarantee abstraction-safety between separately-built programs. We obtain a namespace for abstract types that is global, i.e. meaningful between programs, by hashing module declarations. We examine the scenarios in which values of abstract types are communicated from one program to another, and ensure, by constructing hashes appropriately, that the dynamic and static notions of type equality mirror each other. We use singleton kinds to express abstraction in the static semantics; abstraction is tracked in the dynamic semantics by coloured brackets. These allow us to prove preservation, erasure, and coincidence results. We argue that our proposal is a good basis for extensions to existing ML-like languages, pragmatically straightforward for language users and for implementors.

[1]  Tsung-Min Kuo,et al.  A Facile Tutorial , 1996, CONCUR.

[2]  Susan S. Owicki,et al.  Network objects , 1995 .

[3]  Dan Grossman,et al.  Syntactic type abstraction , 2000, TOPL.

[4]  Benjamin C. Pierce,et al.  Relating Cryptography and Polymorphism , 2000 .

[5]  Benjamin C. Pierce,et al.  Location-Independent Communication for Mobile Agents: A Two-Level Architecture , 1998, ICCL Workshop: Internet Programming Languages.

[6]  Stephanie Weirich,et al.  Higher-Order Intensional Type Analysis , 2002, ESOP.

[7]  Mark Lillibridge,et al.  A type-theoretic approach to higher-order modules with sharing , 1994, POPL '94.

[8]  Peter Sewell,et al.  Global abstraction-safe marshalling with hash types , 2003, ACM SIGPLAN Notices.

[9]  Luca Cardelli,et al.  Abstract Types and the Dot Notation , 1990, Programming Concepts and Methods.

[10]  Robert Harper,et al.  Abstract 1 Introduction , 2022 .

[11]  Derek Dreyer,et al.  A type system for higher-order modules , 2003, POPL '03.

[12]  Dominic Duggan,et al.  Type-Safe linking with recursive DLLs and shared libraries , 2002, TOPL.

[13]  Karl Crary,et al.  Safe and Flexible Dynamic Linking of Native Code , 2000, Types in Compilation.

[14]  Andreas Rossberg,et al.  Dynamic opacity for abstract types , 2002 .

[15]  Robin Milner,et al.  Definition of standard ML , 1990 .

[16]  Peter Sewell Modules, abstract types, and distributed versioning , 2001, POPL '01.

[17]  Xavier Leroy,et al.  Applicative functors and fully transparent higher-order modules , 1995, POPL '95.

[18]  Robert Harper,et al.  Compiling polymorphism using intensional type analysis , 1995, POPL '95.

[19]  Martín Abadi,et al.  Dynamic typing in polymorphic languages , 1995, Journal of Functional Programming.

[20]  Dan Grossman,et al.  Principals in programming languages: a syntactic proof technique , 1999, ICFP '99.

[21]  Gavin M. Bierman,et al.  Dynamic rebinding for marshalling and update, with destruct-time ? , 2003, ICFP '03.

[22]  Stephanie Weirich,et al.  Type-safe cast: (functional pearl) , 2000, ICFP '00.

[23]  中嶋 和久,et al.  環境 Environment について , 1992 .

[24]  David B. MacQueen Modules for standard ML , 1984, LFP '84.

[25]  John C. Mitchell,et al.  Abstract types have existential type , 1988, TOPL.

[26]  Martín Abadi,et al.  Dynamic typing in a statically-typed language , 1989, POPL '89.

[27]  Xavier Leroy,et al.  Manifest types, modules, and separate compilation , 1994, POPL '94.