chymyst-core

Chymyst: declarative concurrency in Scala

Chymyst is a framework for concurrency in functional programming based on the chemical machine paradigm, also known as Join Calculus. The chemical machine concurrency paradigm has the same expressive power as CSP (Communicating Sequential Processes) or the Actor model.

Chymyst Core is a library that implements the high-level concurrency primitives as a domain-specific language in Scala. Chymyst is a framework-in-planning that will build upon Chymyst Core and bring declarative concurrency to practical applications.

The code of Chymyst Core is based on previous Join Calculus implementations by Jiansen He (https://github.com/Jiansen/ScalaJoin, 2011) and Philipp Haller (http://lampwww.epfl.ch/~phaller/joins/index.html, 2008), as well as on my earlier prototypes in Objective-C/iOS and Java/Android.

The Concurrency in Reactions tutorial book: table of contents

Overview of Chymyst and the chemical machine paradigm

Get started with this extensive tutorial book

From actors to reactions: a guide for those familiar with the Actor model

A “Hello, world” project

Video presentation of early version of Chymyst Core, then called JoinRun

This talk was given at Scalæ by the Bay 2016. See also these talk slides revised for the current syntax.

Main features of the chemical machine

Comparison of the chemical machine vs. academic Join Calculus

Comparison of the chemical machine vs. the Actor model

Comparison of the chemical machine vs. the coroutines / channels approach (CSP)

Technical documentation for Chymyst Core

Source code repository for Chymyst Core

Version history and roadmap

Status

The Chymyst Core library is in alpha pre-release, with very few API changes envisioned for the future.

The semantics of the chemical machine (restricted to single-host, multicore computations) is fully implemented and tested on many nontrivial examples.

The library JAR is published to Maven Central.

Extensive tutorial and usage documentation is available.

Unit tests include examples such as asynchronous counter, parallel “or”, concurrent merge-sort, and “dining philosophers”. Test coverage is 100% according to codecov.io.

Performance benchmarks indicate that Chymyst Core can schedule about 100,000 reactions per second per CPU core, and the performance bottleneck is in submitting jobs to threads (a distant second bottleneck is pattern-matching in the internals of the library).