![]() | |
Paradigm | Imperative, procedural, concurrent |
---|---|
Designed by | David May |
Developer | Inmos |
First appeared | 1983 |
Stable release | 2.1 (official), 2.5 (unofficial), 3 (not fully implemented) / 1994 |
Dialects | |
occam-π (pi) | |
Influenced by | |
Communicating sequential processes | |
Influenced | |
Ease, Go, Python |
occam is a programming language which is concurrent and builds on the communicating sequential processes (CSP) process algebra, [1] and shares many of its features. It is named after philosopher William of Ockham after whom Occam's razor is named.
occam is an imperative procedural language (such as Pascal). It was developed by David May and others at Inmos (trademark INMOS), advised by Tony Hoare, as the native programming language for their transputer microprocessors, but implementations for other platforms are available. The most widely known version is occam 2; its programming manual was written by Steven Ericsson-Zenith and others at Inmos.
In the following examples indentation and formatting are critical for parsing the code: expressions are terminated by the end of the line, lists of expressions need to be on the same level of indentation. This feature, named the off-side rule, is also found in other languages such as Haskell and Python.
Communication between processes work through named channels . One process outputs data to a channel via !
while another one inputs data with ?
. Input and output cannot proceed until the other end is ready to accept or offer data. (In the not proceeding case it is often said that the process blocks on the channel. However, the program will neither spin nor poll; thus terms like wait, hang or yield may also convey the behaviour; also in the context that it will not block other independent processes from running.) Examples (c is a variable):
keyboard ? c
screen ! c
SEQ
introduces a list of expressions that are evaluated sequentially. This is not implicit as it is in most other programming languages. Example:
SEQ x := x + 1 y := x * x
PAR
begins a list of expressions that may be evaluated concurrently. Example:
PAR p() q()
ALT
specifies a list of guarded commands. The guards are a combination of a boolean condition and an input expression, both optional. Each guard for which the condition is true and the input channel is ready is successful. One of the successful alternatives is selected for execution. Example:
ALT count1 < 100 & c1 ? data SEQ count1 := count1 + 1 merged ! data count2 < 100 & c2 ? data SEQ count2 := count2 + 1 merged ! data status ? request SEQ out ! count1 out ! count2
This will read data from channels c1 or c2 (whichever is ready) and pass it into a merged channel. If countN reaches 100, reads from the corresponding channel will be disabled. A request on the status channel is answered by outputting the counts to out
.
occam 1 [2] (released 1983) was a preliminary version of the language which borrowed from David May's work on EPL and Tony Hoare's CSP. This supported only the VAR data type, which was an integral type corresponding to the native word length of the target architecture, and arrays of only one dimension.
occam 2 [3] is an extension produced by Inmos Ltd in 1987 that adds floating-point support, functions, multi-dimensional arrays and more data types such as varying sizes of integers (INT16, INT32) and bytes.
With this revision, occam became a language able to express useful programs, whereas occam 1 was more suited to examining algorithms and exploring the new language (however, the occam 1 compiler was written in occam 1, [4] so there is an existence proof that reasonably sized, useful programs could be written in occam 1, despite its limits).
occam 2.1 [1] was the last of the series of occam language developments contributed by Inmos. Defined in 1994, it was influenced by an earlier proposal for an occam 3 language (also referred to as "occam91" during its early development) created by Geoff Barrett at Inmos in the early 1990s. A revised Reference Manual describing occam 3 was distributed for community comment, [5] but the language was never fully implemented in a compiler.
occam 2.1 introduced several new features to occam 2, including:
For a full list of the changes see Appendix P of the Inmos occam 2.1 Reference Manual.
occam-π [6] is the common name for the occam variant implemented by later versions of the Kent Retargetable occam Compiler (KRoC). The addition of the symbol π (pi) to the occam name is an allusion to KRoC occam including several ideas inspired by the π-calculus. It contains several significant extensions to the occam 2.1 compiler, for example:
The transputer is a series of pioneering microprocessors from the 1980s, intended for parallel computing. To support this, each transputer had its own integrated memory and serial communication links to exchange data with other transputers. They were designed and produced by Inmos, a semiconductor company based in Bristol, United Kingdom.
Meiko Scientific Ltd. was a British supercomputer company based in Bristol, founded by members of the design team working on the Inmos transputer microprocessor.
Limbo is a programming language for writing distributed systems and is the language used to write applications for the Inferno operating system. It was designed at Bell Labs by Sean Dorward, Phil Winterbottom, and Rob Pike.
In computer science, communicating sequential processes (CSP) is a formal language for describing patterns of interaction in concurrent systems. It is a member of the family of mathematical theories of concurrency known as process algebras, or process calculi, based on message passing via channels. CSP was highly influential in the design of the occam programming language and also influenced the design of programming languages such as Limbo, RaftLib, Erlang, Go, Crystal, and Clojure's core.async.
JCSP is an implementation of communicating sequential processes (CSP) for the programming language Java.
Code or text folding, or less commonly holophrasting, is a feature of some graphical user interfaces that allows the user to selectively hide ("fold") or display ("unfold") parts of a document. This allows the user to manage large amounts of text while viewing only those subsections that are currently of interest. It is typically used with documents which have a natural tree structure consisting of nested elements. Other names for these features include expand and collapse, code hiding, and outlining. In Microsoft Word, the feature is called "collapsible outlining".
Inmos International plc and two operating subsidiaries, Inmos Limited (UK) and Inmos Corporation (US), was a British semiconductor company founded by Iann Barron, Richard Petritz, and Paul Schroeder in July 1978. Inmos Limited’s head office and design office were at Aztec West business park in Bristol, England.
The Kent Retargetable occam Compiler (KRoC), is computer software, an implementation of the programming language occam, that is based on the Inmos occam 2.1 compiler as a front-end and a retargetable back-end to produce machine code for various microprocessors. Ports of the compiler have been made for PowerPC, SPARC, x86, and Alpha processors.
In computer science, occam-π is the name of a variant of the programming language occam developed by the Kent Retargetable occam Compiler (KRoC) team at the University of Kent. The name reflects the introduction of elements of π-calculus (pi-calculus) into occam, especially concepts involving mobile agents (processes) and data. The language contains several extensions to occam 2.1, including:
In computer science, the Actor model and process calculi are two closely related approaches to the modelling of concurrent digital computation. See Actor model and process calculi history.
In computing, a parallel programming model is an abstraction of parallel computer architecture, with which it is convenient to express algorithms and their composition in programs. The value of a programming model can be judged on its generality: how well a range of different problems can be expressed for a variety of different architectures, and its performance: how efficiently the compiled programs can execute. The implementation of a parallel programming model can take the form of a library invoked from a sequential language, as an extension to an existing language, or as an entirely new language.
Automatic parallelization, also auto parallelization, or autoparallelization refers to converting sequential code into multi-threaded and/or vectorized code in order to use multiple processors simultaneously in a shared-memory multiprocessor (SMP) machine. Fully automatic parallelization of sequential programs is a challenge because it requires complex program analysis and the best approach may depend upon parameter values that are not known at compilation time.
Concurrent computing is a form of computing in which several computations are executed concurrently—during overlapping time periods—instead of sequentially—with one completing before the next starts.
Michael David May FRS FREng is a British computer scientist. He is a Professor in the Department of Computer Science at the University of Bristol and founder of XMOS Semiconductor, serving until February 2014 as the chief technology officer.
Handel-C is a high-level programming language which targets low-level hardware, most commonly used in the programming of FPGAs. It is a rich subset of C, with non-standard extensions to control hardware instantiation with an emphasis on parallelism. Handel-C is to hardware design what the first high-level programming languages were to programming CPUs. Unlike many other design languages that target a specific architecture Handel-C can be compiled to a number of design languages and then synthesised to the corresponding hardware. This frees developers to concentrate on the programming task at hand rather than the idiosyncrasies of a specific design language and architecture.
Process-oriented programming is a programming paradigm that separates the concerns of data structures and the concurrent processes that act upon them. The data structures in this case are typically persistent, complex, and large scale - the subject of general purpose applications, as opposed to specialized processing of specialized data sets seen in high productivity applications (HPC). The model allows the creation of large scale applications that partially share common data sets. Programs are functionally decomposed into parallel processes that create and act upon logically shared data.
The transterpreter is computer software, an interpreter for the transputer, is a virtual machine for the programming language occam-π (occam-pi), and a portable runtime for the KRoC compiler. It is designed for education and research in concurrency and robotics. The transterpreter was developed at the University of Kent.
SuperPascal is an imperative, concurrent computing programming language developed by Per Brinch Hansen. It was designed as a publication language: a thinking tool to enable the clear and concise expression of concepts in parallel programming. This is in contrast with implementation languages which are often complicated with machine details and historical conventions. It was created to address the need at the time for a parallel publication language. Arguably, few languages today are expressive and concise enough to be used as thinking tools.
ISRA VISION PARSYTEC AG is a company of ISRA VISION AG and was founded in 1985 as Parsytec in Aachen, Germany.
{{cite journal}}
: Cite journal requires |journal=
(help)