Occam (programming language): Difference between revisions

Content deleted Content added
Canto3433 (talk | contribs)
No edit summary
Template:Infobox programming language fill. WP:LINKs: add, updates. Nonacronym proper noun WP:ALLCAPS, nonlead-word nonproper noun MOS:CAPS > sentence case. WP:CITs: rename; parameters: cut needless spaces, move vertical bars, author > last + first. Small WP:EoS WP:COPYEDITs. WP:BADEMPHASIS: MOS:BOLDs, quotes > WP:ITALICs or <code>s. Cut needless carriage returns in paragraph. Hyphens > MOS:NDASHes. Full term before WP:ABBR.
Line 4:
|name = occam
|logo =
|paradigm = [[concurrentConcurrent programming languagecomputing|concurrent]]
|year = {{Start date and age|1983}}
|designer = [[David May (computer scientist)|David May]]
|developer = [[INMOSInmos]]
|latest release version = 2.1 (official), 2.5 (unofficial), 3 (not fully implemented)
|latest release date = 1988+
Line 13:
|implementations =
|dialects = [[occam-π]] (pi)
|influenced_byinfluenced by = [[Communicating Sequentialsequential Processesprocesses]]
|influenced = [[Ease (programming language)|Ease]], [[Go (programming language)|Go]]
}}
 
'''occam''' is a [[concurrent programming language]] thatwhich is [[Concurrent computing|concurrent]] and builds on the [[communicating sequential processes]] (CSP) process algebra,<ref name="oc21refman">{{cite book | lastauthor=INMOSInmos | authorlinkauthor-link=INMOSInmos | url=http://www.wotug.org/occam/documentation/oc21refman.pdf |title=occam 2.1 Reference Manual |publisher=SGS-Thomson Microelectronics Ltd |format=PDF |date=1995-05-12}} INMOSInmos document 72 occ 45 03</ref> and shares many of its features. It is named after philosopher [[William of Ockham]] offor whom [[Occam's razor]] fameis named.
 
occam is an [[Imperative programming|imperative]] [[Procedural programming|procedural]] language (such as [[Pascal (programming language)|Pascal]]). It was developed by [[David May (computer scientist)|David May]] and others at [[INMOSInmos]] (trademark INMOS), advised by [[Tony Hoare]], as the native programming language for their [[transputer]] [[microprocessor]]s, 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 [[INMOSInmos]].
 
==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 [[Haskell (programming language)|Haskell]] and [[Python (programming language)|Python]].
 
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 can notcannot 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)|block]]s"'' on the channel. However, the program will neither spin nor poll; thereforethus terms like "''wait"'', "''hang"'' or "''yield"'' may also convey the behaviour -; also in the light of the factcontext that it will not "''block"'' other independent processes from running.) Examples (c is a variable):
 
keyboard ? c
Line 62:
==Language revisions==
===occam 1===
'''occam 1'''<ref name="oc1refman">{{cite book | lastauthor=INMOSInmos | authorlinkauthor-link=INMOSInmos |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===
'''occam 2'''<ref name="oc2refman">{{cite book | last=Ericsson-Zenith |first=Steven |title=occam 2 Reference Manual |publisher=Prentice-Hall |year=1988 |isbn=0-13-629312-3}}</ref> is an extension produced by INMOSInmos 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 capable of expressing 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.co.uk/books?id=nvnnZtJWAZkC&dq=architectures+languages+and+techniques+barry+cook&source=gbs_navlinks_s |title= Occam on Field-Programmable Gate Arrays |first1last1=Cook |first1=Barry M |last1last2=Peel Cook|first2=RMA|last2=Peel |author-link= |date= 1999-04-11 |conference= 22nd World Occam and Transputer User Group Technical Meeting |conference-url= |editor= Barry M. Cook |others= |volume= |edition= |book-title= Architectures, Languages and Techniques for Concurrent Systems |publisher= IOS Press |archive-url= |archive-date= |___location= Keele, United Kingdom |pages= |format= |id= |isbn= 90 5199 480 X |bibcode= |oclc= |doi= |quote= |ref= |postscript= |language= |page= 219 |at= |trans-title= |accessdateaccess-date=2016-11-28}}</ref> so there is an existence proof that reasonably sized, useful programs could be written in occam 1, despite its limitations).
 
===occam 2.1===
'''occam 2.1'''<ref name="oc21refman"/> was the last of the series of occam language developments contributed by INMOSInmos. 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 INMOSInmos in the early 1990s. A revised Reference Manual describing occam 3 was distributed for community comment,<ref name="occam3">{{cite paperjournal |authorlast1=[[Geoff Barrett]] and Steven|first1=Geoff |last2=Ericsson-Zenith |first2=Steven |title=occam 3 Reference Manual |url=http://www.wotug.org/occam/documentation/oc3refman.pdf |date=1992-03-31 |publisher=[[INMOSInmos]] |format=PDF |access-date=2008-03-24}}</ref> but the language was never fully implemented in a compiler.
format=PDF|
accessdate=2008-03-24}}</ref> but the language was never fully implemented in a compiler.
 
occam 2.1 introduced several new features to occam 2, including:
Line 83 ⟶ 81:
*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 INMOSInmos occam 2.1 Reference Manual].
 
===occam-π===
'''[[occam-π]]'''<ref name="kroc">{{cite web |url=http://www.cs.kent.ac.uk/projects/ofa/kroc/ |title=occam-pi: blendingBlending the best of CSP and the pi-calculus |authorlast1=Fred Barnes and|first1=Fred |last2=Welch |first2=Peter Welch|date=2006-01-14 |accessdateaccess-date=2006-11-24}}</ref> is the common name for the occam variant implemented by later versions of [[KRoC]], the Kent Retargetable occam Compiler ([[KRoC]]). The addition of the symbol "''[[Pi (letter)|π]]"'' (pi) to the occam name is an allusion to the fact that KRoC occam includesincluding several ideas inspired by the [[pi-calculus]]. It contains aseveral significant number of extensions to the occam 2.1 compiler, for example:
*Nested protocols
*Run-time process creation
Line 96 ⟶ 94:
 
==See also==
*[[Communicating Sequentialsequential Processesprocesses]]
*The [[XC Programming Language]], which is based on occam but with C-style syntax.
*[[Concurrent computing#Languages supporting concurrent programming|Concurrent programming languages]]
Line 105 ⟶ 103:
 
==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 |last1= Kerridge (ed.) |first1=Jon |title=Transputer and Occam Research: New Directions |year=1993 |publisher=IOS Press |isbn=0-8247-0711-7|pages=253 pages}}
*{{cite book |authorlinklast1=Roscoe |first1=Andrew William |author-link1=Bill Roscoe |lastlast2=RoscoeHoare |firstfirst2=ACharles WAntony Richard |author2author-link2=[[C A RTony Hoare]] |title=The Laws of Occam Programming |year=1986 |publisher=Programming Research Group, Oxford University }}
*Egorov, A., Technical University - Sofia, (1983-2011) '''Записки по Компютърни архитектури'''
 
==External links==
Line 122 ⟶ 120:
===Other implementations===
* [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.
 
{{FOLDOC}}