Content deleted Content added
A bit iffy (talk | contribs) m →occam-π: unnecessary capitalisation |
BrainStack (talk | contribs) Link suggestions feature: 3 links added. |
||
(47 intermediate revisions by 31 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 = [[
| designer = [[David May (computer scientist)|David May]]
| released = {{Start date and age|1983}}
▲|developer = [[INMOS]]
| latest release version = 2.1 (official), 2.5 (unofficial), 3 (not fully implemented)
| latest release date =
| typing =
| implementations =
| dialects = [[occam-π]] (pi)
|
| influenced = [[Ease (programming language)|Ease]], [[Go (programming language)|Go]], [[Python (programming language)|Python]]
}}
'''occam''' is a [[
==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
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 1'''<ref name="oc1refman">{{cite book | last=INMOS | authorlink=INMOS |title=occam Programming Manual|publisher=Prentice-Hall|year=1984|isbn=0-13-629296-8}}</ref> (released 1983) was a preliminary version of the language which borrowed from [[David May (computer scientist)|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===
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,<ref name="cook1">{{cite conference |url=https://books.google.com/books?id=nvnnZtJWAZkC&q=architectures+languages+and+techniques+barry+cook |title= Occam on Field-Programmable Gate Arrays |last1=Cook |first1=Barry M |last2=Peel |first2=RMA |date=1999-04-11 |conference=22nd World Occam and Transputer User Group Technical Meeting |editor-last=Cook |editor-first=Barry M. |book-title=Architectures, Languages and Techniques for Concurrent Systems |publisher=IOS Press |___location=Keele, United Kingdom |isbn= 90-5199-480-X |page=219 |access-date=2016-11-28}}</ref> so there is an existence proof that reasonably sized, useful programs could be written in occam 1, despite its limits).
▲'''occam 2'''<ref name="oc2refman">{{cite book | last=Ericsson-Zenith |title=occam 2 Reference Manual|publisher=Prentice-Hall|year=1988|isbn=0-13-629312-3}}</ref> 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.
===occam 2.1===
▲'''occam 2.1'''<ref name="oc21refman"/> 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,<ref name="occam3">{{cite paper|author=[[Geoff Barrett]] and Steven Ericsson-Zenith|title=occam 3 Reference Manual|url=http://www.wotug.org/occam/documentation/oc3refman.pdf|date=1992-03-31|publisher=[[INMOS]]|
occam 2.1 introduced several new features to occam 2, including:
For a full list of the changes see Appendix P of the [http://www.wotug.org/occam/documentation/oc21refman.pdf
▲* Named data types (DATA TYPE x IS y)
▲* Named Records
▲* Packed Records
▲* Relaxation of some of the type conversion rules
▲* New operators (e.g. BYTESIN)
▲* Channel retyping and channel arrays
▲* Ability to return fixed-length array from function.
▲For a full list of the changes see Appendix P of the [http://www.wotug.org/occam/documentation/oc21refman.pdf INMOS occam 2.1 Reference Manual].
===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
▲* The [[XC Programming Language]], which is based on occam but with C-style syntax.
* [[Concurrent computing#Languages supporting concurrent programming|Concurrent programming languages]]
* [[List of concurrent and parallel programming languages]]
==
{{
== 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}} [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}} [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}} [http://www.booksonline.iospress.com/Content/View.aspx?piid=56]▼
* {{cite book |last= Kerridge |first=Jon |coauthors= (ed.) |title=Transputer and Occam Research: New Directions |year=1993 |publisher=IOS Press |isbn=0-8247-0711-7|pages=253 pages}}▼
* {{cite book |authorlink=Bill Roscoe|last=Roscoe|first=A W |author2=[[C A R Hoare]] |title=The Laws of Occam Programming |year=1986 |publisher=Programming Research Group, Oxford University }}▼
* Egorov, A., Technical University - Sofia, (1983-2011)'''Записки по Компютърни архитектури'''▼
==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].▼
▲*
▲*
▲*
▲== External links ==
* [http://www.cs.kent.ac.uk/projects/ofa/kroc/ KRoC: Kent Retargetable occam Compiler].▼
* [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.▼
▲* [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/
▲* [http://projects.cs.kent.ac.uk/projects/tock/trac/ Tock occam compiler]
{{Authority control}}
[[Category:Concurrent programming languages]]
[[Category:Procedural programming languages]]
|