Go! (programming language)

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

<templatestyles src="Module:Hatnote/styles.css"></templatestyles>

Go!
Paradigm Multi-paradigm: concurrent, logic, functional, imperative (object-based)
Designed by Francis McCabe, Keith Clark
First appeared 2003
Preview release 9-30-07 / September 30, 2007 (2007-09-30)
Typing discipline strong
OS Unix-like
License GPLv2
Website {{#property:P856}}
Influenced by
Prolog[1]

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]

Design

The authors of Go! describe it as "a multi-paradigm programming language that is oriented to the needs of programming secure, production quality, agent based applications. It is multi-threaded, 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 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-style tuple stores."[2]

The authors also propose that the language is suitable for representing ontologies due to its integration of logic, functional and imperative styles of programming.[3]

As a deliberate design choice to reduce complexity, Go! does not support inheritance.

Example

The following example illustrates the "ontology-oriented" type and declarations style of Go!:[3]


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.

Conflict with Google

In November 2009, Google released a similarly named Go programming language (with no exclamation point). McCabe asked Google to change the name of their language as he was concerned they were "steam-rolling over us".[1][4] The issue received attention among technology news websites, with some of them characterizing Go! as "obscure".[5] Google refused to change the name of their language.

References

  1. 1.0 1.1 1.2 Lua error in package.lua at line 80: module 'strict' not found.
  2. 2.0 2.1 Lua error in package.lua at line 80: module 'strict' not found.
  3. 3.0 3.1 Lua error in package.lua at line 80: module 'strict' not found.
  4. Lua error in package.lua at line 80: module 'strict' not found.
  5. Lua error in package.lua at line 80: module 'strict' not found.

Further reading

  • Lua error in package.lua at line 80: module 'strict' not found.
  • Lua error in package.lua at line 80: module 'strict' not found.
  • Lua error in package.lua at line 80: module 'strict' not found.
  • Lua error in package.lua at line 80: module 'strict' not found.
  • Lua error in package.lua at line 80: module 'strict' not found.
  • Lua error in package.lua at line 80: module 'strict' not found.

External links