Io (programming language)

Io
Paradigmsobject-oriented prototype-based
Designed bySteve Dekorte
DevelopersSteve Dekorte, Jonathan Wright, Jeremy Tregunna
First appeared2002; 22 years ago (2002)
Stable release
20170906 / September 6, 2017; 7 years ago (2017-09-06)[1]
Preview release
2019.05.22-alpha / May 22, 2019; 5 years ago (2019-05-22)
Typing disciplinedynamic, strong
PlatformIA-32, x86-64; ARM; .NET CLR
OSWindows, macOS
LicenseBSD 3-clause
Websiteiolanguage.org
Major implementations
Io Io.NET
Influenced by
Smalltalk, NewtonScript, Self, Lua, Lisp, Python, Act1
Influenced
Ioke, Potion

Io is a pure object-oriented programming language inspired by Smalltalk, Self, Lua, Lisp, Act1, and NewtonScript.[2] Io has a prototype-based object model similar to those 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.

Remarkable features of Io are its minimal size and openness to using external code resources.[3] Io is executed by a small, portable virtual machine.

History

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

Philosophy

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

Features

Syntax

In its simplest form, Io syntax is composed of one identifier:[5]

 doStuff

Assuming 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 version

The 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 + 1

translates to:

 1 +(5 *(8)) +(1)

All operators in Io are methods; the fact that they do not require explicit parentheses is a convenience. 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.

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!" println

New 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
    Range 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.

References

  1. ^ "Io Releases". GitHub. Retrieved 2020-02-06.
  2. ^ Io Programming Guide
  3. ^ "Io Programming: Writing Addons". Wikibooks.org: open books for an open world. Retrieved 2023-06-22.
  4. ^ Tate, Bruce (2010). "Chapter 3: Io". Seven Languages in Seven Weeks: A Pragmatic Guide to Learning Programming Languages (1st ed.). Raleigh, North Carolina: Pragmatic Bookshelf. p. 60, 72. ISBN 978-1934356593.
  5. ^ "io guide". iolanguage.org. Retrieved 2023-06-22.

Read other articles:

Artikel ini sebatang kara, artinya tidak ada artikel lain yang memiliki pranala balik ke halaman ini.Bantulah menambah pranala ke artikel ini dari artikel yang berhubungan atau coba peralatan pencari pranala.Tag ini diberikan pada Desember 2022. Konstantin PavlovInformasi pribadiNama lengkap Konstantin Sergeyevich PavlovTanggal lahir 21 Januari 1989 (umur 35)Tinggi 1,78 m (5 ft 10 in)Posisi bermain GelandangInformasi klubKlub saat ini FC Spartak KostromaKarier senior*Tahun...

 

 

  لمعانٍ أخرى، طالع نيو لندن (توضيح). نيو لندن   الإحداثيات 32°15′22″N 94°55′54″W / 32.2561°N 94.9317°W / 32.2561; -94.9317  [1] تقسيم إداري  البلد الولايات المتحدة[2][3]  التقسيم الأعلى مقاطعة روسك  خصائص جغرافية  المساحة 22.39916 كيلومتر مربع22.314868 كيلومتر �...

 

 

UkrainaУкраїнаUkrajina Flagga Statsvapen Valspråk: Volja, Zlahoda, Dobro(ukrainska för Frihet, enighet, godhet) Nationalsång: Ще не вмерла Україна (Sjtje ne vmerla Ukraina)(svenskaː Ännu lever Ukraina)Ukrainas nationalsång (instrumentalisk) läge Huvudstad(även största stad) Kiev Officiellt språk Ukrainska Statsskick Republik  -  President Volodymyr Zelenskyj  -  Premiärminister Denys Sjmyhal Självständighet Från Sovjetunione...

العلاقات البرازيلية النيجيرية البرازيل نيجيريا   البرازيل   نيجيريا تعديل مصدري - تعديل   العلاقات البرازيلية النيجيرية هي العلاقات الثنائية التي تجمع بين البرازيل ونيجيريا.[1][2][3][4][5] مقارنة بين البلدين هذه مقارنة عامة ومرجعية للدولتين: �...

 

 

Paul RusesabaginaLahirPaul Rusesabagina15 Juni 1954 (umur 69)Murama, RwandaTempat tinggalSan Antonio, Texas, AS[1][2]KebangsaanRwandaSuami/istri Esther Bamurage (bercerai) Tatiana Rusesabagina ​ ​(m. 1989)​ Penghargaan Presidential Medal of Freedom Immortal Chaplains Prize for Humanity Wallenberg Medal of the University of Michigan National Civil Rights Museum Freedom Award Tom Lantos Human Rights Prize from The Lantos Foundation for Hu...

 

 

Elm cultivar Ulmus glabra 'Horizontalis''Horizontalis', Seafield Cemetery, EdinburghSpeciesUlmus glabraCultivar'Horizontalis'OriginPerth, Scotland The Wych Elm cultivar Ulmus glabra 'Horizontalis', commonly known as the Weeping Wych Elm or Horizontal Elm, was discovered in a Perth nursery circa 1816. The tree was originally identified as 'Pendula' by Loddiges (London), in his catalogue of 1836, a name adopted by Loudon two years later in Arboretum et Fruticetum Britannicum, 3: 1398, 1838, but...

artikel ini tidak memiliki pranala ke artikel lain. Tidak ada alasan yang diberikan. Bantu kami untuk mengembangkannya dengan memberikan pranala ke artikel lain secukupnya. (Pelajari cara dan kapan saatnya untuk menghapus pesan templat ini) Artikel ini sebatang kara, artinya tidak ada artikel lain yang memiliki pranala balik ke halaman ini.Bantulah menambah pranala ke artikel ini dari artikel yang berhubungan atau coba peralatan pencari pranala.Tag ini diberikan pada Februari 2023. Margaret O...

 

 

Ovid Metamorphoses – Combe changing to the bird, engraving, ca. 1700 In Greek mythology, Combe (Ancient Greek: Κόμβη) was a daughter of the river god Asopus. Greek deitiesseries Primordial deities Titans and Olympians Water deities Chthonic deities Personified concepts Nymphs Alseid Anthousai Auloniad Aurae Crinaeae Daphnaie Dryads Eleionomae Epimeliads Hamadryads Hesperides Hyades Lampads Leimakids Leuce Limnades Meliae Melinoë Minthe Naiads Napaeae Nephele Nereids Oceanids Oreads Pe...

 

 

Maritime branch of the French National Gendarmerie Maritime GendarmerieGendarmerie maritimeAgency overviewFormed1832 – present[1][2]Employees1,157Jurisdictional structureOperations jurisdictionFranceGeneral natureGendarmerieSpecialist jurisdictionCoastal patrol, marine border protection, marine search and rescue.Operational structureParent agencyNational Gendarmerie National Gendarmerie Components Departmental GendarmerieMobile GendarmerieRepublican GuardMaritime Gendarmerie...

Community school in Rottingdean, East Sussex, EnglandLonghill High SchoolAddressFalmer RoadRottingdean, East Sussex, BN2 7FREngland, United KingdomCoordinates50°49′06″N 0°04′03″W / 50.8184°N 0.0676°W / 50.8184; -0.0676InformationTypeCommunity schoolLocal authorityBrighton and HoveDepartment for Education URN114581 TablesOfstedReportsGenderMixedAge11 to 16Enrolment892Websitehttp://www.longhill.brighton-hove.sch.uk/ Longhill High School is a co-education...

 

 

La violenza contro le persone LGBT è posta in essere da azioni volte a ledere l'integrità psicofisica della persona, a causa della propria identità di genere o del proprio orientamento sessuale. Queste condotte possono essere compiute sia da singoli (eventualmente in concorso tra loro) oppure da gruppi organizzati (anche, in alcuni contesti, derivanti da istituzioni governative). La violenza può estrinsecarsi in modi variegati: attraverso condotte fisiche e violente[1] o vessatori...

 

 

Admiration for the United States This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Pro-Americanism – news · newspapers · books · scholar · JSTOR (July 2023) (Learn how and when to remove this message) Look up Americophilia in Wiktionary, the free dictionary. Pro-Americanism (also called pro-American sentiment ...

COVID-19 pandemic in OhioMap of the outbreak in Ohio by confirmed new infections per 100,000 people over 14 days (updated June 13, 2024)   1,000+   500–1,000   200–500   100–200   50–100   20–50   10–20   0–10   no casesPercent of total population in each county of Ohio who have started the COVID-19 vaccination (at least one shot) on October 26, 2023   >80%   70 - 80...

 

 

Main article: 1992 United States presidential election 1992 United States presidential election in Illinois ← 1988 November 3, 1992 1996 → Turnout76.51%   Nominee Bill Clinton George H. W. Bush Ross Perot Party Democratic Republican Independent Home state Arkansas Texas Texas Running mate Al Gore Dan Quayle James Stockdale Electoral vote 22 0 0 Popular vote 2,453,350 1,734,096 840,515 Percentage 48.58% 34.34% 16.64% County ResultsCongressional D...

 

 

Self-similar growth curve Spira mirabilis redirects here. For the orchestra, see Spira Mirabilis (orchestra). For the Italian film, see Spira Mirabilis (film). Logarithmic spiral (pitch 10°) A section of the Mandelbrot set following a logarithmic spiral A logarithmic spiral, equiangular spiral, or growth spiral is a self-similar spiral curve that often appears in nature. The first to describe a logarithmic spiral was Albrecht Dürer (1525) who called it an eternal line (ewige Linie).[1&#...

В Википедии есть статьи о других людях с такой фамилией, см. Алексеева; Алексеева, Елена. Елена Алексеева Личная информация Пол ж Страна  Россия Специализация натурбан Дата рождения 14 июля 1990(1990-07-14) (33 года) Место рождения Кандалакша Мурманская область Елена Евгеньевна ...

 

 

Tugboat of the United States Navy Not to be confused with USS Katherine (SP-715). USS Katherine K. during World War I. History United States NameUSS Katherine K. NamesakePrevious name retained BuilderM. D. Battomer, Baltimore, Maryland Completed1894 Acquired9 June 1917; delivered 10 July 1917 Commissioned7 September 1917 FateWrecked 9–10 September 1919 NotesOperated as civilian tugboat Katherine K. 1894-1917 General characteristics TypeTug and patrol vessel Tonnage14 Gross register tons Len...

 

 

Pakistani politician NISharifuddin Pirzadaشریف الدین پیرزادہ سيدPirzada in 20079th Minister of Foreign AffairsIn office31 August 1966 – 1 May 1968PresidentAyub KhanPreceded byZulfikar Ali BhuttoSucceeded byMian Arshad HussainAttorney General of PakistanIn office1968–1971PresidentYahya KhanPreceded byPost establishedSucceeded byYahya BakhtiarIn office1977–1984Preceded byYahya BakhtiarSucceeded byAziz A. MunshiSecretary General of the Organisation of Islamic Co...

American television sitcom (2009–2015) This article is about the television series. For a list of parks and recreation departments, see Department of Parks and Recreation. Parks and RecreationAlso known asParks and RecGenre Sitcom Mockumentary Political satire Cringe comedy[1] Created by Greg Daniels Michael Schur ShowrunnerMichael SchurStarring Amy Poehler Rashida Jones Paul Schneider Aziz Ansari Nick Offerman Aubrey Plaza Chris Pratt Adam Scott Rob Lowe Jim O'Heir Retta Billy Eich...

 

 

Irish mid 2000s asset price bubble Houses prices in Ireland (2000–2010)   Nationwide   Dublin The Irish property bubble was the speculative excess element of a long-term price increase of real estate in the Republic of Ireland from the early 2000s to 2007, a period known as the later part of the Celtic Tiger. In 2006, the prices peaked at the top of the bubble, with a combination of increased speculative construction (financed almost entirely by senior debt) and rapidly ...