Content deleted Content added
→Further reading: cite repair; |
BrainStack (talk | contribs) Link suggestions feature: 3 links added. |
||
(33 intermediate revisions by 22 users not shown) | |||
Line 1:
{{Short description|Concurrent programming language}}
{{Distinguish|OCaml}}
{{lowercase title|occam (programming language)}} {{Infobox programming language
| name = occam
| logo = 1983 1988 Trademark occam and occam 2 INMOS Limited.jpg
| paradigm = [[Imperative programming|Imperative]], [[Procedural programming|procedural]], [[Concurrent computing|concurrent]]
| designer = [[David May (computer scientist)|David May]]▼
|year = {{Start date and age|1983}}▼
| developer = [[Inmos]]▼
▲|designer = [[David May (computer scientist)|David May]]
▲|developer = [[Inmos]]
| latest release version = 2.1 (official), 2.5 (unofficial), 3 (not fully implemented)
| latest release date =
| typing =
| implementations =
| dialects = [[occam-π]] (pi)
| influenced by = [[Communicating sequential processes]]
| influenced = [[Ease (programming language)|Ease]], [[Go (programming language)|Go]], [[Python (programming language)|Python]]
}}
'''occam''' is a [[programming language]] which is [[Concurrent computing|concurrent]] and builds on the [[communicating sequential processes]] (CSP) process algebra,<ref name="oc21refman">{{cite book |author=
==Overview==
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 [[
Communication between processes work through named ''[[Channel (programming)|channels]]''. One process outputs data to a channel via <code>!</code> while another one inputs data with <code>?</code>. 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 ''[[Blocking (computing)|
keyboard ? c
Line 30 ⟶ 31:
screen ! c
SEQ
Line 36 ⟶ 37:
y := x * x
PAR
Line 42 ⟶ 43:
q()
ALT
Line 58 ⟶ 59:
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 <code>out</code>.
==Language revisions==
[[File:1983 Programming manual occam by INMOS Limited.jpg|thumb|1983 "occam" by INMOS Limited]]
===occam 1===
===occam 2===
With this revision, occam became a language
===occam 2.1===
occam 2.1 introduced several new features to occam 2, including:
Line 76 ⟶ 79:
*Named records
*Packed records
*Relaxation of some of the [[type conversion]] rules
*New operators (e.g. BYTESIN)
*Channel retyping and channel arrays
Line 84 ⟶ 87:
===occam-π===
*[[Nesting (computing)|Nested]] [[Protocol (object-oriented programming)|protocols]]
*Run-time process creation
*Mobile channels, data, and processes
*[[
*Protocol [[Inheritance (object-oriented programming)|inheritance]]
*
*Extended [[
==See also==
* The
* [[Concurrent computing#Languages supporting concurrent programming|Concurrent programming languages]]
▲*The [[XC Programming Language]], which is based on occam but with C-style syntax.
* [[
==References==
Line 103 ⟶ 105:
==Further reading==
*{{cite book |title=Communicating Process Architectures 2007 – WoTUG-30 |year=2007 |publisher=IOS Press |isbn=978-1-58603-767-3|pages=513 pages}} [https://web.archive.org/web/20070927235308/http://www.booksonline.iospress.com/Content/View.aspx?piid=5962]
*{{cite book |title=Communicating Process Architectures 2006 – WoTUG-29 |year=2006 |publisher=IOS Press |isbn=978-1-58603-671-3 |pages=391 pages}} [https://web.archive.org/web/20070927235321/http://www.booksonline.iospress.com/Content/View.aspx?piid=91]
*{{cite book |title=Communicating Process Architectures 2005 – WoTUG-28 |year=2005 |publisher=IOS Press |isbn=978-1-58603-561-7 |pages=405 pages}} [https://web.archive.org/web/20070927235351/http://www.booksonline.iospress.com/Content/View.aspx?piid=56]
*{{cite book |editor-last=Kerridge |editor-first=Jon |title=Transputer and Occam Research: New Directions
*{{cite book |last1=Roscoe |first1=Andrew William |author-link1=Bill Roscoe |last2=Hoare |first2=Charles Antony Richard |author-link2=Tony Hoare |title=The Laws of Occam Programming |year=1986 |publisher=Programming Research Group, Oxford University}}
*Egorov, A., Technical University – Sofia, (
== External links ==
* Information, compilers, editors and utilities at the [http://www.wotug.org/occam/ WoTUG occam pages].▼
* Compilers, documentation, examples, projects and utilities at the [http://www.wotug.org/parallel/occam/ Internet Parallel Computing Archive] (no longer maintained).▼
* Occam books on [http://www.transputer.net/obooks/obooks.asp Transputer.net].▼
▲* [http://www.wotug.org/occam/ Information, compilers, editors and utilities at the
▲* [http://www.wotug.org/parallel/occam/ Compilers, documentation, examples, projects and utilities at the
* [http://www.cs.kent.ac.uk/projects/ofa/kroc/ The occam-pi language].
* [http://projects.cs.kent.ac.uk/projects/tock/trac/ Tock occam compiler] – (translator from occam to C from Kent) a Haskell-based compiler for occam and related languages.
{{Authority control}}
[[Category:Concurrent programming languages]]
[[Category:Procedural programming languages]]
|