An Implementation of Transparent Migration on Standard Scheme

Eijiro Sumii · 2002

I present a handy (though somewhat restrictive) way to im-plement mobile computation a la Telescript on top of stan-dard Scheme. Background. Mobile computation is an eÆcient and eec-tive approach to distributed programming where a program works by migrating from one host to another. The migration is called transparent if the execution state of the program is preserved before and after the migration. Transparent mi-gration is preferable to non-transparent, because it is easier to use for application programmers. At the same time, how-ever, it is harder to implement for language developers: all existing implementations (to my knowledge) of transparent migration need either a custom runtime system (e.g. [13]) or global source code transformation (e.g. [12]). Our Method. In this presentation, I describe a library to enable transparent migration in standard Scheme. Unlike existing implementations, it requires neither modication of the runtime system nor transformation of the source code. It works by (i) extracting a delimited continuation [5, 6] with control operators (shift and reset), (ii) reifying the de-limited continuation|i.e., reconstructing its source code| with type-directed partial evaluation (TDPE) [2, 4], and (iii) evaluating the source code at the remote host (e.g. by in-voking ssh). Assuming the function shift for delimited-continuation extraction and the operator # for TDPE, the main part of the library looks like: (de ne (go rhost) (shift (lambda (k) ; extract the delimited continuation (let ([e (# k)]) ; reconstruct its source code (reval e rhost))))) ; remotely evaluate the source code Note that the delimited continuation k has the type ()! (), because the transparent migration operator go works as a side eect. Since TDPE itself uses control operators, the library actually uses layered control operators [8]. For details of (layered) delimited continuations and TDPE, see Appendix A and B, respectively. Example 1. Consider the following program. (In the ex-amples, we use the non-standard procedure system for the sake of convenience.) (de ne (hellos) Visiting scholar at the University of Pennsylvania. Research fel-low of the Japan Society for the Promotion of Science. (begin (reset; delimits the continuation (display "hello from ")

Read the paper · More papers on PaperTik