Chymyst: declarative concurrency in Scala

Chymyst is a framework for concurrency in functional programming implementing the chemical machine paradigm, also known in the academic world 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 He Jiansen (, 2011) and Philipp Haller (, 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

Concurrency in Reactions: Get started with this extensive tutorial book

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

A “Hello, world” project

Presentations on Chymyst and the chemical machine programming paradigm

Oct. 16, 2017: Talk given at the Scala Bay meetup:

July 2017: Draft of an academic paper describing Chymyst and its approach to join calculus

Nov. 11, 2016: Talk given at Scalæ by the Bay 2016:

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


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

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).