Skip to content

brinkar/rubycsp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby CSP

Communicating Sequential Processes library for Ruby.

Introduction

CSP is a formal language for defining concurrent systems that can be verified mathematically, making it possible to prove the correctness of your concurrent system, ie. that there are no deadlocks, race conditions etc. This library is an implementation of CSP in Ruby 1.9 that introduces a new and better way of developing concurrent programs in Ruby, something that can otherwise be very hard.

The library has been influenced by other CSP implementations including PyCSP (for Python), JCSP (for Java), C++ CSP and Occam, with some other concepts introduced to make it more Ruby-ish wherever possible. You can check out the syntax and behaviour of the library by looking at the files in the examples/ and test/ directories. Later on, a more formal tutorial and some API-docs might be created.

Please note that this library only works with Ruby 1.9, and has only been tested on Linux.

Features

Currently implemented featues include:

  • Processes.
  • Process maps for running processes in parallel.
  • Process labelling for easy reusing of processes.
  • Channels. Can be shared and buffered.
  • Poisoning of channels.
  • Read/write restriction using channel ends.
  • Some simplifying functions for doing common stuff easily.
  • Alternation with input, output, timeout and skip guards.
  • Test and example suite.

Planned features:

  • OS processes. Distribute CSP processes (fibers) on a number of Ruby processes, making it possible to take advantage of multiple CPU cores.
  • Transparent network support. Channels are shared on a TCP socket so that any process can run anywhere on the network.
  • Native processes. Creating an easy way to implement your processes in C/++ or Fortran, possibly using the RubyInline gem.
  • Visualization and inspection. Automatic graph creation for inspecting your CSP network.
  • Logging. Something like CSP traces could be implemented for generic logging and inspection of the state of a system.
  • Suspending/resuming processes and networks. If it’s actually usable for anything.
  • Mobility. Look into pi-calculus and see if some of the concepts of process and channel mobility could be implemented.
  • API docs
  • Gem

About

CSP (Communicating Sequential Processes) library for Ruby

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages