# The Network as a Language Construct

Tony Garnock-Jones tonyg@ccs.neu.edu

Sam Tobin-Hochstadt samth@cs.indiana.edu

Matthias Felleisen matthias@ccs.neu.edu

## Abstract

The actor model inspires several important programming languages. In this model, communicating concurrent actors collaborate to produce a result. A pure actor language tends to turn systems into an organization-free collection of processes, however, even though most applications call for layered and tiered architectures. To address this lack of an organizational principle, programmers invent design patterns.

This paper investigates integrating some of these basic patterns via a programming language construct. Specifically, it extends a calculus of communicating actors with a “network” construct so that actors can conduct scoped, tiered conversations. The paper then sketches how to articulate design ideas in the calculus, how to implement it, and how such an implementation shapes application programming.

## Paper

The paper was presented at ESOP 2014.

## Proof Scripts

We used Coq version 8.4pl2 to formulate and prove our claims about our Basic Actor Model and our Network Calculus. The proof scripts are available here:

- proofs for Basic Actor Model
- proofs for full Network Calculus

## Redex Model and Examples

The paper references the Redex models that we built of both the Basic Actor Model and the Network Calculus. The models are available here:

- model of Basic Actor Model
- model of full Network Calculus

We also constructed a handful of examples using the Redex model, to explore the dynamics of the system:

- nc-telnet-chatserver.rkt, the example chat service from section 5 of the paper.
- nc-chatroom.rkt, a different formulation of a chat service that makes more sophisticated use of service presence and relaying instead of simulating
`telnet`

. - nc-bridge.rkt, an example that didn’t make it into the paper, demonstrating transparent “stitching together” of subnets into a contiguous overlay network using a relay actor.
- bam-example.rkt, a trivial example of the Basic Actor Model in operation.

To run an example, place it in a directory alongside redex-utils.rkt, network-calculus.rkt, and basic-actor-model.rkt. Then, from your command line, run

$ racketexamplename.rkt

## Further Resources

Please see the Marketplace homepage, which contains links to source code, documentation, case studies etc.