Io
lastmod 2015-07-02created 2015-05-0511 edits
Io is a prototype-based programming language inspired by Smalltalk (all values are objects, all messages are dynamic), Self (prototype-based), NewtonScript (differential inheritance), Act1 (actors and futures for concurrency), LISP (code is a runtime inspectable/modifiable tree) and Lua (small, embeddable).
Io is a pure object-oriented programming language influenced by Smalltalk, Self, Lua, Lisp, and NewtonScript. Like the object models of Self and NewtonScript, Io has a prototype object model that removes the distinction between instances and classes. As in Smalltalk, everything is an object and is dynamically typed. Like Lisp, it has no statements, and program flow is made up of a set of functions. All code is passed as message objects so that it is lazily evaluated, and it is evaluated when needed. A program is therefore nothing more than a data tree. Io handles concurrency using the actor model, a technique uncommon in modern programming languages.
Simple Io features
- Everything is an object.
- All interaction happens by sending messages to objects.
- Instances are not created from classes. They are created by cloning objects called prototypes.
- An object remembers its prototype.
- An object is a collection of slots.
- Slots hold objects. This includes method objects.
- A message returns the value held in a slot or calls the method inside it.
- If an object cannot respond to a message sent to it, it forwards the message to its prototype.
ETC
- By convention in Io, types should start with an uppercase letter.
Example
Hello Io
New object
In Io, you can create a new object as follows.
Favorite site
- Io language web site
- Wikipedia (en) article on Io
- Io Tutorial
- Io Programming Guide
- Wikibooks: Io Programming