A Compiler for the Join Calculus

Description

The Core Join Calculus is an experimental programming language described in
1. C. Fournet, G. Gonthier. The reflexive CHAM and the join-calculus. In POPL'96.
2. C. Fournet, G. Gonthier, J-J. Levy, L. Maranget, D. Remy. A Calculus of Mobile Agents. In CONCUR'96.

`cjcc` is an experimental compiler of the core join calculus into C. Feel free to download it, play with it, and change it as you like. I would be happy about feedback.

Obtaining cjcc

You can download the source code, or executable files for Solaris or Linux, from here. The current version is v0.5.2.

Usage

Try out the sample join calculus files: `gcd.j` and `numbers.j`. Both these programs perform arithmetic calculations on natural numbers read from standard input. Sorry for the currently poor documentation.

To compile a join calculus file, first use `cjcc` to generate C code, then use a C-compiler to get an executable file. (Or use the batch file `j`). For example, to compile and run the file `numbers.j`, type

cjcc -o numbers.c numbers.j gcc -o numbers numbers.c numbers

Syntax

Here is a brief summary of the syntax that `cjcc` uses for the join calculus: Values v ::= x | 123 | "abc" | true | false | _ Processes P ::= x<v1,...,vn> {} {P} P | P def D in P def /* name */ D in P Definitions D ::= J --> P D and D Join Patterns J ::= x<y1,...,yn> J | J (all yi distinct names) System calls: write <value,continuation,exception> readint <int_result,exc> equal <int1,int2,boole_result,exc> similarly less plus <int1,int2,int_result,exc> similarly minus,times,div if <boole,then_cont,else_cont,exc>

Changes

```v0.5.2 2004/11/24: fixed expected number of shift/reduce conflicts

of bison

v0.5 1997/09/04: minor update. A bug reported by Luca Padovani, which
affected only the "DEBUG" mode, has been fixed.

v0.4 1996/10/01: first public release.
```

Copyright (C) 1996, 1997, 2004 Peter Selinger

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

Back to Homepage:

Peter Selinger / Department of Mathematics and Statistics / Dalhousie University
selinger@mathstat.dal.ca / PGP key