Table of Contents
Fetching ...

Linear Contextual Metaprogramming and Session Types

Pedro Ângelo, Atsushi Igarashi, Vasco T. Vasconcelos

TL;DR

This work tackles the challenge of integrating metaprogramming with linear context tracking and session types to enable typed code generation and remote code exchange. It develops a call-by-value linear lambda calculus with multi-level contexts and a box modality to stage contextual code and track free variables via contextual types. It sketches extensions to concurrency and session types, introducing primitives for channel-based communication and a process layer to support servers producing code on demand. The work lays a foundation for safe distributed metaprogramming with linear resources and points toward algorithmic type checking and richer session-type features in future work.

Abstract

We explore the integration of metaprogramming in a call-by-value linear lambda-calculus and sketch its extension to a session type system. We build on a model of contextual modal type theory with multi-level contexts, where contextual values, closing arbitrary terms over a series of variables, may then be boxed and transmitted in messages. Once received, one such value may then be unboxed (with a let-box construct) and locally applied before being run. We present a series of examples where servers prepare and ship code on demand via session typed messages.

Linear Contextual Metaprogramming and Session Types

TL;DR

This work tackles the challenge of integrating metaprogramming with linear context tracking and session types to enable typed code generation and remote code exchange. It develops a call-by-value linear lambda calculus with multi-level contexts and a box modality to stage contextual code and track free variables via contextual types. It sketches extensions to concurrency and session types, introducing primitives for channel-based communication and a process layer to support servers producing code on demand. The work lays a foundation for safe distributed metaprogramming with linear resources and points toward algorithmic type checking and richer session-type features in future work.

Abstract

We explore the integration of metaprogramming in a call-by-value linear lambda-calculus and sketch its extension to a session type system. We build on a model of contextual modal type theory with multi-level contexts, where contextual values, closing arbitrary terms over a series of variables, may then be boxed and transmitted in messages. Once received, one such value may then be unboxed (with a let-box construct) and locally applied before being run. We present a series of examples where servers prepare and ship code on demand via session typed messages.
Paper Structure (15 sections, 1 theorem, 5 equations)