Go! (programming language)

This is an old revision of this page, as edited by Jonovision (talk | contribs) at 05:07, 16 November 2009 (Moved text out of summary to comply with Wikipedia:NOT_PAPER; removed dubious "influenced Erlang" sentence). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Go! is an agent-based programming language in the tradition of logic-based programming languages like Prolog.[1] It was introduced in a 2003 paper by Francis McCabe and Keith Clark.[2]

Go!
ParadigmMulti-paradigm: concurrent, logic, functional, object-oriented, imperative
Designed byFrancis McCabe, Keith Clark
First appeared2003
Preview release
9-30-07 / September 30, 2007 (2007-09-30)
Typing disciplinestrong
OSUnix-like
LicenseGPLv2
Influenced by
Prolog, April

Google's programming language Go (note lack of exclamation point) has, since its 2009 release, been the subject of an as yet unresolved naming controversy with Go! due to its very similar name.[3][4]

Design

It is oriented to the needs of programming secure, production quality, agent based applications. It is multithreaded, strongly typed and 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 need be. Threads in different agents communicate and coordinate using asynchronous messages. Threads within the same agent can also use shared dynamic relations acting as memory stores.

Its nature as a multi-paradigm programming language, integrating logic, functional, object-oriented, and imperative programming styles,[5] is particularly applied to ontology-based modeling, as exploited for the Semantic Web in allowing a type system where OWL classes can be represented in the type system.[6] The design of Go!, according to Bordini et al.'s survey,[5] also took into consideration critical issues such as security, transparency, and integrity, in regards to the adoption of logic programming technology.

Threads within a single Go! process, hence in the same agent, can also communicate by manipulating dynamic relation objects, comparable with Linda tuple stores,[5] used to coordinate their activities. A related combination of tuple-based shared stores and Semantics has been taken up as the communication mechanism in the approaches of the TripCom.org[7] and SOA4All[8] projects.

Example

The following example illustrates the 'ontology-oriented' type and declarations style of Go!.

Gender::= male | female.
person <˜ {dayOfBirth:[]=>day. age:[]=>integer.
gender:[]=>Gender. name:[]=>string.
home:[]=>string. lives:[string]{}}.
person:[string,day,Gender,string]$=person.
person(Nm,Born,Sx,Hm)..{
dayOfBirth()=>Born.
age() => yearsBetween(now(),Born).
gender()=>Sx.
name()=>Nm.
home()=>Hm.
lives(Pl) :- Pl=home().
yearsBetween:[integer,day]=>integer.
yearsBetween(...) => ..
}.
newPerson:[string,day,Gender,string]=>person.
newPerson(Nm,Born,Sx,Hm)=>$person(Nm,Born,Sx,Hm).

The ::= rule defines a new algebraic data type, a data type with only data constructors.

The rule defines an interface type - it indicates what properties are characteristic of a person and also gives type constraints on these properties. It documents that age is a functional property with an integer value, that lives is a unary relation over strings, and that dayOfBirth is a functional property with a value that is an object of type day.

The $= type rule indicates that there is also a theory label, with the functor "person", for a theory that defines the characteristic properties of the person type - implements the person interface - in terms of four given parameters of types string, day, Gender, and string.

Footnotes

  1. ^ Claburn, Thomas (2009-11-11). "Google 'Go' Name Brings Accusations Of 'Evil'". InformationWeek. Retrieved 2009-11-14.
  2. ^ Clark and McCabe, AAMAS'03, 2003
  3. ^ Claburn, Thomas (2009-11-11). "Google 'Go' Name Brings Accusations Of 'Evil'". InformationWeek. Retrieved 2009-11-14.
  4. ^ "Issue 9 - go - I have already used the name for *MY* programming language". code.google.com. 2009-11-10. Retrieved 2009-11-14.
  5. ^ a b c Bordini et al., Informatica, 2006
  6. ^ Clark and McCabe, Applied Intelligence, 2006
  7. ^ TripCom
  8. ^ Soa4al.eu

References