Skip to content

phaller/ScalaJoins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scala Joins

Author: Philipp Haller

Summary

Join patterns are an attractive declarative way to synchronize both threads and asynchronous distributed computations. This library integrates joins into Scala based on extensible pattern matching provided by extractors. Scala Joins supports join patterns with multiple synchronous events, and guards. Joins are also integrated with actors. It enables the use of join patterns in the context of more advanced synchronization modes, such as future-type message sending and token-passing continuations.

Releases

  • Release v0.5 (for Scala 2.11)
  • Release v0.4 (original release)

Paper

The main ideas of the implementation are explained in the following paper:

Philipp Haller and Tom Van Cutsem. Implementing Joins Using Extensible Pattern Matching. COORDINATION 2008: 135-152 [DOI] [Springer] [EPFL]

Build and Test

The Scala Joins library can be compiled and run using Scala 2.11.x.

$ tar xzf ScalaJoins-0.5.tar.gz
$ cd ScalaJoins-0.5
$ mkdir classes
$ scalac -d classes src/joins/*.scala

The main joins.scala file contains a runnable test:

$ scala -cp classes joins.joinsTest
getty: 4
get1: helloworld

The synchronous channel example is compiled and run as follows:

$ scalac -d classes examples/syncChannel.scala
$ scala -cp classes examples.syncChannel
wrote: ()
read: 42

The FIFO example is compiled and run as follows:

$ scalac -d classes examples/FIFO.scala
$ scala -cp classes examples.testFIFO
case 1
42

About

A library for join patterns in Scala

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages