|
Occam occurs as parallel programming language that builds on Communicating Sequential Processes (CSP) and shares numbers of of their features. These are known as fallowing William of Ockham of Occam's Razor fame. Occam is, around how else, the practical practicable implementation of CSP.
Occam is an imperative procedural language (such as Pascal). It was developed by Inmos for their line of Transputers, but implementations for more platforms survive too.
Overview
within a as a consequence examples indentation & formatting come critical for parsing the code: expressions come terminated per prevent of the line, lists of expressions want to become on the equivalent level of indentation (this feature is besides discovered in more languages, like Python, Haskell, Icon, Miranda, and ABC).
Communication between processes operate across known as trend lines. the single run outputs information to a channel via ! when some other of these input file using ?. Input & output may prevent until a more prevent is ready to assume or even offer information. Examples (c occurs as variable):
keyboard ? c
screen ! c
SEQ introduces the listings of expressions that come evaluated consecutive. This is does'nt inexplicit when these are inside virtually all more programing language. Lesson:
SEQ
x := ten + 1
y := x * x
PAR begins the names of expressions that can be evaluated at the same time. Lesson:
PAR
x := ten + 1
y := y * 2
ALT specifies the listing of restrained commands. A guards come combination of the boolean affliction & an input expression (each optional). Both guard for which a trouble is admittedly & a input channel is quick is successful. One of a successful option is selected for execution. Case:
ALT
count1 < 100 & c1 ? data
SEQ
count1 := count1 + 1
incorporate ! data
count2 < 100 & c2 ? data
SEQ
count2 := count2 + 1
incorporated ! data
status ? request
SEQ
retired ! count1
retired ! count2
This might scan information from either trend lines c1 or even c2 (whichever is quick) & pass it into the incorporate channel. Whenever countN reaches Centred, reads from either a corresponding channel is disabled. a asking on the status channel is answered by outputting the numbers to retired.
Language revisions
Occam 2
Occam Two is an extension by INMOS Ltd around 1987 that adds swimming-point, functions & additional language types prefer variable sizes of whole number (INT16, INT32) & character types.
By having this revision william of ockham became a language capable of expressing utile software online, whereas occam Unity was thomas more suited to examining algorithmic program & researching the freshly language.
["occam 2 Reference Manual", INMOS, P-H 1988, ISBN 0-13-629312-3].
Occam 2.1
Occam Two.Unity occurs as 2nd sweetening to ockham, produced around 1988 by INMOS Ltd. It was a survive of the series language developments contributed by INMOS. Despite its "incremental" version total, it was the important update in the utility of the language, introducing:
Known as information types (Information Nature and severity ten IS y);
Known as Records;
Packed Records;
Relaxation of occasionally of the nature and severity conversion system;
Fresh operators (e.g. BYTESIN)
Channel retyping & channel arrays;
Ability to link to fixed-length array from either work;
For the to the full names of the changes understand Appendix P of the [http://www.wotug.org/occam/documentation/oc21refman.pdf INMOS Occam 2.1 Reference Manual].
Occam 3
Occam Three was a title for a proposal for the next-generation william of ockham language, created by one of the senior computer programmer at INMOS. The specification was created & distributed for community comment. the freshly language involved a heavy total of changes, numbers of of which were focussed at making code sharing, genus pan development, & design reuse more comfortable.
A [http://www.wotug.org/occam/documentation/oc3refman.pdf Occam 3] specification is available, however there are no compiler was created for this variant of the language, partially due to problems in INMOS and its subsequent takeover.
A bit of elements from either william of ockham Troika were introduced into a ockham Deuce.I compiler by more teams, & come to become referred to as 'william of occam Deuce.Five' - when within "half-way there"!
Occam 2.5
Occam Two.Fin is the most common title for the language compiled per Kent Retargettable Occam compiler KRoC. It contains the important total of extensions to the william of occam Deuce.One compiler, e.g.:
nested protocols
redo-instance run creation
free to wander trend lines, information, & processes
recursion;
protocol inheritance;
array builder;
extended rendezvous.
A KRoC team stand processed a compiler available in their web site. Within recent days, a team has decided to rename a compiler to Occam-Pi, because of a use of theories from either the Pi-calculus.
|