Skip to content
Projekte

Über uns

Programmiersprache Io. Inspiriert von Self, Smalltalk und LISP.

Programmiersprachen und Laufzeitumgebungen

So werden diese Zahlen gemessen

Gemessener Sternzuwachs

in 24h
-1
in 7 days
+3
in 15 days
+4
in 1 month
+9

Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.

README.md

Original

The Io Language

This is a reference for building and running Io. For a guide to the language itself, see https://iolanguage.org/docs/Guide.

Contents

What is Io?

Io is a dynamic prototype-based programming language in the same family as Smalltalk and Self. Everything is a message send from one object to another.

The programming guide and reference manual live in the docs folder.

Example Code

Basic math:

Io> 1 + 1
==> 2

Io> 2 sqrt
==> 1.4142135623730951

Lists:

Io> d := List clone append(30, 10, 5, 20)
==> list(30, 10, 5, 20)

Io> d := d sort
==> list(5, 10, 20, 30)

Io> d select (>10)
==> list(20, 30)

Objects:

Io> Contact := Object clone
==>  Contact_0x7fbc3bc8a6d0:
  type = "Contact"

Io> Contact name ::= nil
Io> Contact address ::= nil
Io> Contact city ::= nil

Io> holmes := Contact clone setName("Holmes") setAddress("221B Baker St") setCity("London")
==>  Contact_0x7fbc3be2b470:
  address          = "221B Baker St"
  city             = "London"
  name             = "Holmes"

Io> Contact fullAddress := method(list(name, address, city) join("\n"))
Io> holmes fullAddress
==> Holmes
221B Baker St
London

Quick Links

Getting Io

None of these need a build:

  • In a browser: the Live Interpreter runs the full VM in the page.

  • From JavaScript, in Node or a browser: the @iolanguage/io npm package.

    npm install @iolanguage/io
    
    import { Io } from "@iolanguage/io";
    
    const io = await Io.load();
    const { output } = await io.eval("list(1, 2, 3) map(x, x * x) sum");   // "==> 14\n"
    

    Io can call JavaScript and await its Promises, and its coroutines and actors run inside the JS event loop. See the package README.

  • From the command line: download io_static.wasm from the latest release and run it with wasmtime:

    curl -LO https://github.com/IoLanguage/io/releases/latest/download/io_static.wasm
    wasmtime io_static.wasm -e '"hello" println'
    wasmtime --dir=. io_static.wasm script.io
    

To build Io yourself, see Building.

Platform

Io targets WebAssembly. A single WASI binary runs under any WASI host (wasmtime, Node, browsers via WASI shims) and ships with a browser REPL and a bidirectional Io↔JavaScript bridge.

The previous native build (CMake, dynamic addons, Eerie package manager) is on the native branch and the 2026.04.20-native-final tag. It is no longer maintained: it gets no fixes or releases, and issues are only tracked for the WebAssembly build on master.

Building

Prerequisites: wasi-sdk and wasmtime.

git clone --recursive https://github.com/IoLanguage/io.git
cd io
make

The build looks for wasi-sdk in deps/wasi-sdk (untracked), then ~/wasi-sdk. If it is somewhere else, point WASI_SDK at it:

make WASI_SDK=/opt/wasi-sdk

Make targets:

Target What it does
make Build build/bin/io_static (WASI CLI binary)
make test Build build/bin/test_iterative_eval
make check Run both test suites under wasmtime
make browser Build browser/io_browser.wasm (browser REPL)
make serve Serve the browser REPL at http://localhost:8000
make check-browser Run browser tests under Playwright
make regenerate Regenerate IoVMInit.c from .io sources
make clean Remove build artifacts

Running

Run a one-liner:

wasmtime build/bin/io_static -e '"hello" println'

Run a script (pass --dir=. so the WASI sandbox can read the file):

wasmtime --dir=. build/bin/io_static path/to/script.io

Start the REPL:

wasmtime build/bin/io_static

Browser REPL

make serve

Then open http://localhost:8000. See browser/README.md for details on embedding the REPL in a page and calling between Io and JavaScript. To use Io from your own JavaScript, the npm package is simpler; see Getting Io.

Running Tests

make check

Or run the suites individually:

wasmtime build/bin/test_iterative_eval
wasmtime --dir=. --dir=/tmp build/bin/io_static libs/iovm/tests/correctness/run.io

Set IO_TEST_VERBOSE=1 for per-test output.

Extending Io

The native addon system (DynLib, AddonLoader, Eerie) is not available on WebAssembly. Host integration goes through the JavaScript bridge instead: Io code can call JS functions, and JS can call Io methods. See browser/README.md and agents/wasm/Bridge.md.

Ähnliche Projekte entdecken

Wird geladen…