Occam (programming language)
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. OverviewIn 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 keyboard ? c screen ! c
SEQ x := x + 1 y := x * x
PAR p() q()
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 Language revisions![]() occam 1occam 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 2occam 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.1occam 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-π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:
See also
References
Further reading
External links
|
Portal di Ensiklopedia Dunia