syn·di·catea language for interactive programs

Syndicate

Syndicate is an Actor-based programming language offering

  • pub/sub pattern-based message routing, for mapping events to actors

  • dataspaces, stores for semi-structured data, for managing shared state

  • state change notifications for keeping actors informed of changes in dataspaces

  • integrated techniques for registering and discovering services and for cleaning up after both graceful and unexpected actor failures

  • recursive layering of groups of actors, each group with a private dataspace of its own, for organising larger programs

Together, these features help programmers organise their interactive programs.

Example

These two actors implement a toy “bank account” actor that listens for deposit messages and maintains an account balance record in the shared dataspace. The first is written using Syndicate implemented for Racket, and the second using Syndicate for JavaScript.

(spawn
 (field [balance 0])
 (assert (account (balance)))
 (on (message (deposit $amount))
     (balance (+ (balance) amount))))
spawn {
  field this.balance = 0;
  assert account(this.balance);
  on message deposit($amount) {
    this.balance += amount;
  }
}

The next two implement a client for the “bank account”. Each time the balance in the shared dataspace changes, they print a message to the console.

(spawn
 (on (asserted (account $balance))
     (printf "Balance: ~a\n" balance)))
spawn {
  on asserted account($balance) {
    console.log("Balance:", balance);
  }
}

The full code for the Racket example is bank-account.rkt, and for the JavaScript example, demo-bankaccount.js.

Live Syndicate/js demos

This page links to in-browser runnable demos (and source code) of Syndicate/js programs.

Install

Follow the instructions here.

Source Code

Syndicate is implemented both for Racket and for JavaScript.

Link to Syndicate github repo The Syndicate github repository contains implementations along with some larger example programs.

Documentation

The system is still somewhat in flux, and documentation is still being written. My dissertation has a chapter describing the Racket implementation of Syndicate and a chapter including many examples demonstrating idioms of Syndicate programming.

Dissertation

A resource page is available, including links to the PDF and HTML versions of the dissertation document, a recording of my defense talk, and the corresponding slides.

Tony Garnock-Jones, “Conversational Concurrency”, PhD dissertation, December 2017, College of Computer and Information Science, Northeastern University, Boston, Massachusetts. (PDF; HTML; Resources)

Papers

Tony Garnock-Jones, “From Events To Reactions: A Progress Report”, In: Proc. PLACES 2016 (workshop), April 2016, Eindhoven, Netherlands. (PDF; Slides)

Tony Garnock-Jones and Matthias Felleisen, “Coordinated Concurrent Programming in Syndicate”, In: Proc. ESOP 2016, April 2016, Eindhoven, Netherlands. (PDF; Slides)

Tony Garnock-Jones, Sam Tobin-Hochstadt, and Matthias Felleisen, “The Network as a Language Construct”, In: Proc. ESOP 2014, April 2016, Eindhoven, Netherlands. (PDF; Slides)

Contact

Please feel free to email me at tonyg@leastfixedpoint.com.