Jump to content

Joyce (programming language)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by JamieHanlon (talk | contribs) at 11:17, 12 May 2010 (An initial version, but not yet complete). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Joyce
Paradigmconcurrent, imperative, structured
Designed byBrinch Hansen
First appeared1987
Stable release
1 / 1987
Typing disciplineStrong
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

  1. ^ Per Brinch Hansen, Joyce--A programming language for distributed systems
  2. ^ Per Brinch Hansen, The Joyce language report, Software--Practice and experience, Vol. 19(6), 553-578 (June 1989)
  • 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.