db_connect: Could not connect to paper db at "wotug@dragon.kent.ac.uk"
db_connect: Could not connect to paper db at "wotug@dragon.kent.ac.uk"
%T CSP as a Domain\-Specific Language Embedded in Python and Jython
db_connect: Could not connect to paper db at "wotug@dragon.kent.ac.uk"
%A Sarah Mount, Mohammad Hammoudeh, Sam Wilson, Robert Newman
db_connect: Could not connect to paper db at "wotug@dragon.kent.ac.uk"
%E Peter H. Welch, Herman Roebbers, Jan F. Broenink, Frederick R. M. Barnes, Carl G. Ritson, Adam T. Sampson, G. S. Stiles, Brian Vinter
%B Communicating Process Architectures 2009
%X Recently, much discussion has taken place within the
Python
programming community on how best to support
concurrent programming.
This paper describes a new Python
library, python\-csp, which
implements synchronous,
message\-passing concurrency based on
Hoare\[rs]s
Communicating Sequential Processes. Although
other CSP libraries have
been written for Python,
python\-csp has a number of novel features.
The library is
implemented both as an object hierarchy and as
a
domain\-specific language, meaning that programmers can
compose
processes and guards using infix operators, similar
to the original
CSP syntax. The language design is intended
to be idiomatic Python and
is therefore quite different to
other CSP libraries. python\-csp
targets the CPython
interpreter and has variants which reify CSP
process as
Python threads and operating system processes. An
equivalent
library targets the Jython interpreter, where CSP
processes
are reified as Java threads. jython\-csp also has
Java wrappers which
allow the library to be used from pure
Java programs. We describe
these aspects of python\-csp,
together with performance benchmarks and
a formal analysis
of channel synchronisation and choice, using the
model
checker SPIN.