JoinActors: A Modular Library for Actors with Join Patterns

📅 2026-02-15
🏛️ The Art, Science, and Engineering of Programming
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the limitations of existing join pattern implementations, which often rely on domain-specific languages and exhibit rigid, inflexible matching algorithms that hinder integration into general-purpose programming ecosystems. To overcome these challenges, we propose and implement JoinActors—a modular and extensible join pattern matching library built on Scala 3. JoinActors is the first library to support join patterns natively within a general-purpose language, offering an intuitive API powered by metaprogramming and incorporating fair join semantics. Its key innovation lies in enabling plug-and-play support for multiple matching algorithms, facilitating direct performance comparisons. Experimental results demonstrate that the new implementation significantly improves performance while preserving matching correctness, thereby providing an efficient coordination mechanism for complex message-passing systems and establishing a reusable experimental platform for future research on join patterns.

Technology Category

Application Category

📝 Abstract
Join patterns are a high-level programming construct for message-passing applications. They offer an intuitive and declarative approach for specifying how concurrent and distributed components coordinate, possibly depending on complex conditions over combinations of messages. Join patterns have inspired many implementations -- but most of them are not available as libraries: rather, they are domain-specific languages that can be hard to integrate into pre-existing ecosystems. Moreover, all implementations ship with a predefined matching algorithm, which may not be optimal depending on the application requirements. These limitations are addressed by `JoinActors`, a recently published library which integrates join patterns in the off-the-shelf Scala 3 programming language, and is designed to be modular w.r.t. the matching algorithm in use. In this work we address the problem of designing, developing, and evaluating a modular join pattern matching toolkit that (1) can be used as a regular library with a developer-friendly syntax within a pre-existing programming language, and (2) has an extensible design that supports the use and comparison of different matching algorithms. We analyse how `JoinActors` achieves goals (1) and (2) above. The paper that introduced `JoinActors` only briefly outlined its design and implementation (as its main goal was formalising its novel fair matching semantics*). In this work we present and discuss in detail an improved version of `JoinActors`, focusing on its use of metaprogramming (which enables an intuitive API resembling standard pattern matching) and on its modular design. We show how this enables the integration of multiple matching algorithms with different optimisations and we evaluate their performance via benchmarks covering different workloads. We illustrate a sophisticated use of Scala 3's metaprogramming for the integration of an advanced concurrent programming construct within a pre-existing language. In addition, we discuss the insights and"lessons learned"in optimising join pattern matching, and how they are facilitated by `JoinActors`'s modularity -- which allows for the systematic comparison of multiple matching algorithm implementations. We adopt the fair join pattern matching semantics and the benchmark suite from the paper that originally introduced `JoinActors`. Through extensive testing we ensure that our new optimised matching algorithms produce exactly the same matches as the original `JoinActors` library, while achieving significantly better performance. The improved version of `JoinActors` is the companion artifact of this paper. This work showcases the expressiveness, effectiveness, and usability of join patterns for implementing complex coordination patterns in distributed message-passing systems, within a pre-existing language. It also demonstrates promising performance results, with significant improvements over previous work. Besides the practical promise, `JoinActors`'s modular design offers a research playground for exploring and comparing new join pattern matching algorithms, possibly based on entirely different semantics.
Problem

Research questions and friction points this paper is trying to address.

join patterns
modular library
matching algorithms
message-passing concurrency
Scala metaprogramming
Innovation

Methods, ideas, or system contributions that make the work stand out.

join patterns
modular matching algorithms
Scala 3 metaprogramming
concurrent programming
message-passing systems
🔎 Similar Papers
No similar papers found.