Joyce (programming language)
Paradigm | concurrent, imperative, structured |
---|---|
Designed by | Brinch Hansen |
First appeared | 1987 |
Stable release | 1
/ 1987 |
Typing discipline | Strong |
Influenced by | |
Communicating Sequential Processes, Pascal, Concurrent Pascal | |
Influenced | |
SuperPascal |
Joyce is a secure, concurrent programming langauge designed by Per Brinch Hansen in the 1980s[1]. It is based on the sequential langauge Pascal and the principles of Communicating Sequential Processes (CSP). It was created to address the shortcomings of CSP to be applied itself as a programming langauge, and to povide a tool, primarily for teaching, for distributed system implementation.
The language is based around the concept of agents; concurrently executed pocesses that communicate only by the use of channels and message passing. Agents may activate sub-agents dynamically and recursively. The development of Joyce formed the foundation of the language SuperPascal, also developed by Brinch Hansen around 1993.
Features
Joyce is based on a small subset of Pascal, extended with features inspired from CSP for concurrency[2]. The following sections describe the some of the more novel features that were introduced.
Agents
An agent is a procedure comprised of a set of statements and possibly nested definitions of other agents. An agent may dynamically activate sub-agents which execute concurrently with their creator. An agent can terminate only when all of its sub-agents have also terminated. For example, an agent process2
activates process1
:
agent process1(); begin ... end; agent process2(x, y: integer); use process1; begin process1(); end;
The activation of an agent creates new instances of all local variables and the value of each formal parameter is copied to a local variable. Hence, agents cannot access variables of other agents and are allowed only to communicate through the use of channels. This restriction prevents problems associated with the use of shared variables such as race conditions.
Channels and ports
Input/output statements
Polling statements
Security
Joyce was designed to be a secure langauge in the sense that a compiler would be able to detect all violations of the langauge rules.
Example program
Syntax
Blocks
Scope
Implementation
References
External links
- Per Brinch Hansen Archive - A collection of Brinch Hansen's papers and the SuperPascal software which can be downloaded in a compressed file, and contains the full language specification and useful documentation.