Go! (programming language): Difference between revisions

Content deleted Content added
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.8.6
remove random crap
 
(15 intermediate revisions by 10 users not shown)
Line 1:
{{Short description|Multi-paradigm programming language}}
{{for|the language released in 2009 by Google|Go (programming language)}}
{{Infobox programming language
Line 12 ⟶ 13:
| latest_release_date =
| latest_test_version = 9-30-07
| latest_test_date = {{Start date and age|mf=yes|2007|9|30}}
| typing = [[strong typing|strong]]
| implementations =
Line 26 ⟶ 27:
== Design ==
 
The authors of Go! describe it as "a [[multi-paradigm programming language]] that is oriented to the needs of programming secure, production quality and agent-based applications. It is [[multi-threaded]], strongly typed and [[higher order function|higher order]] (in the functional programming sense). It has relation, function and action procedure definitions. Threads execute action procedures, calling functions and querying relations as needed. Threads in different agents communicate and coordinate using asynchronous messages. Threads within the same agent can also use shared dynamic relations acting as [[Linda (coordination language)|Linda]]-style [[tuple space|tuple stores]]."<ref name="aamas">{{cite book |last1=Clark |first1=K.L. |last2=McCabe |first2=F.G. |yeartitle=2003Proceedings of the second international joint conference on Autonomous agents and multiagent systems |titlechapter= Go! forFor multi-threaded deliberative agents |journalyear=International Conference on Autonomous Agents (AAMAS'03)2003 |pages=964–965 | doi=10.1145/860575.860747 |isbn=978-1581136838 |citeseerx=10.1.1.117.184 |s2cid=2047545 }}</ref>
 
The authors also propose that the language is suitable for representing [[Ontology (information science)|ontologies]] due to its integration of [[logic programming|logic]], [[functional programming|functional]] and [[imperative programming|imperative]] styles of programming.<ref name="applied">{{cite journal | doi=10.1007/s10489-006-8511-x | title=Ontology oriented programming in go! | date=2006 | last1=Clark | first1=K. L. | last2=McCabe | first2=F. G. |year=2006 |title=Ontology oriented programming in go! |journal=Applied Intelligence | volume=24 | issue=3 | pages=189–204 |doi=10.1145/860575.860747 |citeseerx=10.1.1.117.184 |s2cid=2047545 }}</ref>
 
== Example ==
The following example illustrates the "ontology-oriented" type and declarations style of Go!:<ref name=applied />
<syntaxhighlight lang="prolog">
<!-- Don't use <source> tag, because there is wikitext in the source code. -->
Sex [[#algebraic|'''::=''']] male | female.
person [[#interface|'''<~''']] {dayOfBirth:[] '''=>''' ''day''.
age:[] '''=>''' ''integer''.
sex:[] '''=>''' Sex.
name:[] '''=>''' ''string''.
home:[] '''=>''' ''string''.
lives:[''string'']{}}.
person:[''string'', ''day'', Sex, ''string''] [[#theory|'''$=''']] person.
person(Nm, Born, Sx, Hm)..{
dayOfBirth() '''=>''' Born.
age() '''=>''' yearsBetween(now(), Born).
sex() '''=>''' Sx.
name() '''=>''' Nm.
home() '''=>''' Hm.
lives(Pl) [[Prolog#Rules and facts|''':-''']] Pl '''=''' home().
yearsBetween:[''integer'', ''day''] '''=>''' integer.
yearsBetween(...) '''=>''' ..
}.
newPerson:[''string'', ''day'', Sex, ''string''] '''=>''' person.
newPerson(Nm, Born, Sx, Hm) '''=>''' $person(Nm, Born, Sx, Hm).
 
person [[#interface|'''<~''']] {dayOfBirth:[] '''=>''' ''day''.
{{anchor|algebraic}}The <code>::=</code> rule defines a new [[algebraic data type]], a [[data type]] with only data constructors.
age:[] '''=>''' ''integer''.
sex:[] '''=>''' Sex.
name:[] '''=>''' ''string''.
home:[] '''=>''' ''string''.
lives:[''string'']{}}.
 
person:[''string'', ''day'', Sex, ''string''] [[#theory|'''$=''']] person.
{{anchor|interface}}The <code><~</code> rule defines an interface type - it indicates what properties are characteristic of a <code>person</code> and also gives type constraints on these properties. It documents that <code>age</code> is a functional property with an integer value, that <code>lives</code> is a unary relation over strings, and that <code>dayOfBirth</code> is a functional property with a value that is an object of type <code>day</code>.
 
person(Nm, Born, Sx, Hm)..{
{{anchor|theory}}The <code>$=</code> type rule indicates that there is also a theory label, with the functor <code>person</code>, for a theory that defines the characteristic properties of the <code>person</code> type - implements the <code>person</code> interface - in terms of four given parameters of types <code>string</code>, <code>day</code> , <code>Sex</code>, and <code>string</code>.
dayOfBirth() '''=>''' Born.
age() '''=>''' yearsBetween(now(), Born).
sex() '''=>''' Sx.
name() '''=>''' Nm.
home() '''=>''' Hm.
lives(Pl) [[Prolog#Rules and facts|''':-''']] Pl '''=''' home().
yearsBetween:[''integer'', ''day''] '''=>''' integer.
yearsBetween(...) '''=>''' ..
}.
 
newPerson:[''string'', ''day'', Sex, ''string''] '''=>''' person.
 
newPerson(Nm, Born, Sx, Hm) '''=>''' $person(Nm, Born, Sx, Hm).
</syntaxhighlight>
{{anchor|algebraic}}*The <code>::=</code> rule defines a new [[algebraic data type]], a [[data type]] with only data constructors.
{{anchor|interface}}*The <code><~</code> rule defines an interface type - it indicates what properties are characteristic of a <code>person</code> and also gives type constraints on these properties. It documents that <code>age</code> is a functional property with an integer value, that <code>lives</code> is a unary relation over strings, and that <code>dayOfBirth</code> is a functional property with a value that is an object of type <code>day</code>.
{{anchor|theory}}*The <code>$=</code> type rule indicates that there is also a theory label, with the functor <code>person</code>, for a theory that defines the characteristic properties of the <code>person</code> type - implements the <code>person</code> interface - in terms of four given parameters of types <code>string</code>, <code>day</code> , <code>Sex</code>, and <code>string</code>.
 
==Conflict with Google==
Line 73 ⟶ 72:
==Further reading==
{{Refbegin}}
* {{cite documentweb |last1=Clark |first1=K. L. |last2=McCabe |first2=F. G. |year=2003 |title=Ontology Oriented Programming in Go! |url=http://www.doc.ic.ac.uk/~klc/DistKR.pdf }}
* {{cite journal |last1=Clark |first1=K. L. |last2=McCabe |first2=F. G. |year=2004 |title=Go!—A Multi-Paradigm Programming Language for Implementing Multi-Threaded Agents |journal=[[Annals of Mathematics and Artificial Intelligence]] |volume=41 |issue=2–4 |pages=171–206 |url=http://portal.acm.org/citation.cfm?id=998367 |doi=10.1023/B:AMAI.0000031195.87297.d9 |citeseerx=10.1.1.133.1069 |s2cid=6992205 }}
* {{cite journal |author=R. Bordini |year=2006 |title=A Survey of Programming Languages and Platforms for Multi-Agent Systems |journal=Informatica |volume=30 |pages=33–44 |url=http://www.informatica.si/vol30.htm |display-authors=etal |url-status=dead |archive-url=https://web.archive.org/web/20091115151833/http://www.informatica.si/vol30.htm |archive-date=2009-11-15 }}
* {{cite journal |author=M. Fisher |year=2007 |title=Computational Logics and Agents - A Roadmap of Current Technologies and Future Trends |journal=Computational Intelligence |volume=23 |issue=1 |pages=61–91 |url=http://www3.interscience.wiley.com/journal/118495224/issue |archive-url=https://archive.today/20130106033209/http://www3.interscience.wiley.com/journal/118495224/issue |url-status=dead |archive-date=2013-01-06 |doi=10.1111/j.1467-8640.2007.00295.x |display-authors=etal |citeseerx=10.1.1.114.6149 |s2cid=3393868 }}
*{{cite book|last=McCabe|first=Francis G.|title=Lets Go!|url=https://books.google.com/books?isbn=0975444913|date=February 7, 2007|publisher=Network Agent Press|isbn=978-0-9754449-1-7}}
* {{cite conference |author=C. Varela |year=2004 |title=On Modelling Agent Systems with Erlang | conference=ACM SIGPLAN Erlang Workshop '04 |conference-url=http://ftp.sunet.se/pub/lang/erlang/workshop/2004/ |display-authors=etal |access-date=2009-11-12 |archive-date=2009-11-15 |archive-url=https://web.archive.org/web/20091115113314/http://ftp.sunet.se/pub/lang/erlang/workshop/2004/ |url-status=dead}}
{{Refend}}
 
Line 86 ⟶ 85:
 
[[Category:Concurrent programming languages]]
[[Category:Free compilers and interpretersopen source compilers]]
[[Category:Programming languages created in 2003]]