Io (programming language)

Io (programming language)

Infobox programming language
name = Io

paradigm = object-oriented prototype-based
year = 2002
designer = Steve Dekorte
developer = Steve Dekorte (and others)
latest release version = 20060704
latest release date = July 4, 2006
typing = dynamic, strong
implementations = Io
dialects =
influenced_by = Smalltalk, NewtonScript, Self, Lua, Lisp, Act1
influenced =

Io is a pure object-oriented programming language inspired by Smalltalk, Self, Lua, Lisp, Act1, and NewtonScript [ [http://www.iolanguage.com/scm/git/checkout/Io/docs/IoGuide.html Io Programming Guide ] ] . Io has a prototype-based object model similar to the ones in Self and NewtonScript, eliminating the distinction between instance and class. Like Smalltalk, everything is an object and it uses dynamic typing. Like Lisp, programs are just data trees. Io uses actors for concurrency, a technique rarely used in modern programming languages.

Remarkable features of Io are its minimal size and openness to using external code resources. Fact|date=July 2008 Io is executed by a small, portable virtual machine.

__TOC__

History

The language was created by Steve Dekorte around March 7, 2002, after trying to help a friend, Dru Nelson, with his language, Cel. He found out that he really didn't know much about how languages worked, and set out to write a tiny language to understand the problems better.

Philosophy

Io's goal is to explore conceptual unification and dynamic languages, so the tradeoffs tend to favor simplicity and flexibility over performance.

Features

* pure object-oriented based on prototypes
* exception handling
* Perl-like regular expressions
* incremental garbage collecting supporting weak links
* highly portable
* DLL/shared library dynamic loading on most platforms
* introspection, reflection and metaprogramming
* Actor-based concurrency
* Coroutines
* small virtual machine
* higher-order functions

Syntax

The syntax of Io is almost non-existent. In its simplest form, it is composed of a single identifier: doStuffAssuming the above doStuff is a method, it is being called with zero arguments and as a result, explicit parentheses are not required.

If doStuff had arguments, it would look like this: doStuff(42)Io is a message passing language, and since everything in Io is a message (excluding comments), each message is sent to a receiver. The above example demonstrates this well, but not fully. To describe this point better, let's look at the next example: System versionThe above example demonstrates message passing in Io; the "version" message is sent to the "System" object.

Operators are a special case where the syntax is not as cut-and-dried as the above examples. The Io parser intercepts a set of operators defined by the interpreter, and translates them to method calls. For example, the following: 1 + 5 * 8 + 1translates to: 1 +(5 *(8)) +(1)As you can see, there is also a little bit of operator precedence happening here, and the precedence levels are the same as with the C precedence levels.

Operators were also turned into method calls. In fact, all operators in Io are methods; the fact that they do not require explicit parentheses is a convenience.

Methods and blocks

In Io there are two ways of creating anonymous functions: methods and blocks. Between them, they are almost identical except for scope. While blocks have lexical scope, methods have dynamic scope.

Both "method" and "block" are higher-order functions.

Examples

The ubiquitous Hello world program: "Hello, world!" printlnNew objects are created by cloning objects. In Io specifically, a new, empty object is created and only the differences between it and its parent are stored within the new object; this behavior is known as differential inheritance. An example of this behavior is shown: A := Object clone // creates a new, empty object named "A"A simple non-recursive factorial function, in Io:factorial := method(n, if(n = 0, return 1) res := 1 1 to(n) foreach(i, res = res * i))Because assignment of res * i to res is the last action taken, the function implicitly returns the result and so an explicit return expression is not needed. The above demonstrates the usage of ranges, and doesn't use a for() loop, which would be faster.

Notes

External links

* [http://iolanguage.com/ Io] home page
* [http://iota.flowsnake.org/ Io Notes]
* [http://synrc.com/io-language.htm Io Language for .NET]
* [http://dmoz.org/Computers/Programming/Languages/Io/ Open Directory: Programming: Languages: Io]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Programming language — lists Alphabetical Categorical Chronological Generational A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that… …   Wikipedia

  • Programming language theory — (commonly known as PLT) is a branch of computer science that deals with the design, implementation, analysis, characterization, and classification of programming languages and programming language features. It is a multi disciplinary field, both… …   Wikipedia

  • Programming Language Design and Implementation — (PLDI) is one of the ACM SIGPLAN s most important conferences. The precursor of PLDI was the Symposium on Compiler Optimization, held July 27–28, 1970 at the University of Illinois at Urbana Champaign and chaired by Robert S. Northcote. That… …   Wikipedia

  • Programming Language for Business — or PL/B is a business oriented programming language originally called DATABUS and designed by Datapoint in the early 1970s as an alternative to COBOL because its 8 bit computers could not fit COBOL into their limited memory, and because COBOL did …   Wikipedia

  • programming language — ➔ language * * * programming language UK US noun [C] ► COMPUTER LANGUAGE(Cf. ↑computer language) …   Financial and business terms

  • programming language — Language Lan guage, n. [OE. langage, F. langage, fr. L. lingua the tongue, hence speech, language; akin to E. tongue. See {Tongue}, cf. {Lingual}.] [1913 Webster] 1. Any means of conveying or communicating ideas; specifically, human speech; the… …   The Collaborative International Dictionary of English

  • Programming Language One — Programming Language One, oft als PL/I (auch PL/1, PL1 oder PLI) abgekürzt ist eine Programmiersprache, die in den 1960er Jahren von IBM entwickelt wurde. Die Bezeichnung PL/1 ist vor allem in Deutschland gebräuchlich. Ursprünglich wurde PL/I… …   Deutsch Wikipedia

  • Programming Language 1 — noun A computer programming language which combines the best qualities of commercial and scientific oriented languages (abbrev PL/1) • • • Main Entry: ↑programme …   Useful english dictionary

  • Programming Language —   [engl.], Programmiersprache …   Universal-Lexikon

  • Programming language specification — A programming language specification is an artifact that defines a programming language so that users and implementors can agree on what programs in that language mean.A programming language specification can take several forms, including the… …   Wikipedia

  • programming language — noun (computer science) a language designed for programming computers • Syn: ↑programing language • Topics: ↑computer science, ↑computing • Hypernyms: ↑artificial language …   Useful english dictionary

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”