Questions tagged [iolanguage]

Io is a pure, prototype-based, object-oriented dynamic programming language.

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).

Features

  • BSD license
  • small vm (~10K semicolons)
  • multi-state (multiple VMs in same process)
  • incremental collector, weak links
  • actor-based concurrency, coroutines
  • 64bit clean C99 implementation
  • embeddable
  • exceptions

Philosophy

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

( sources iolanguage.com & Wikipedia )

65 questions
2
votes
1 answer

Error compiling the io programming language

I'm trying to compile io but it's failing and I can't understand why. Here's what I did to compile it: mkdir build && cd build cmake .. make Here's a gist of output from cmake Which seems fine but when I run make (gist of the output) it fails with…
errorhandler
  • 1,757
  • 3
  • 22
  • 29
2
votes
2 answers

Make Io language works on Ubuntu 14.04

In order to run following example, I install Io on my Ubuntu 14.04. But many Addons donot work. Socket Size URL ... I follow the post to install Io on my Ubuntu 14.04. Io example code from "Seven language in Seven Weeks": futureResult := URL…
Amitabha
  • 1,693
  • 2
  • 25
  • 42
2
votes
2 answers

Io Language : Exception: Object does not respond to 'URL'

Today I'm exercising an Io example of "seven language of seven weeks." Example code: futureResult := URL with("http://google.com/") @fetch writeln("Do something immediately while fetch goes on in background...") writeln("This will block until the…
Amitabha
  • 1,693
  • 2
  • 25
  • 42
2
votes
2 answers

iolanguage getSlot does not return expected object

Recently i started to learn iolanguage. When trying out the "method" message, i wrote: Io> f := method(getSlot("f")) ==> method( getSlot("f") ) Io> slotSummary ==> Object_0x97f41a8: Lobby = Object_0x97f41a8 Protos =…
jayven
  • 770
  • 8
  • 19
2
votes
1 answer

In Io language, what's the difference between 1 proto and 1 type?

Io> 1 proto == Number ==> true Io> 1 type == Number ==> false Io> 1 proto ==> 0 Io> 1 type ==> Number I'm very confused about this. Does anyone have ideas about this?
Hanfei Sun
  • 45,281
  • 39
  • 129
  • 237
2
votes
1 answer

Embedding Io language: Call Io method from C

I'm writing a game engine and I'd like to use Io for scripting. The engine is written in pure C99, not C++. I've successfully bound Io to some of the game's C functions, and it works well. However, I'd like to call Io methods in the C game loop.…
Peter C
  • 6,219
  • 1
  • 25
  • 37
2
votes
2 answers

Why does the Io REPL and the interpreter give me two different values?

Consider this code: OperatorTable addOperator(":", 2) : := method(value, list(self, value) ) hash := "key": "value" hash println The return should be list(key, value), and when using this in the Io REPL that is exactly the return value. When…
krainboltgreene
  • 1,841
  • 2
  • 17
  • 25
1
vote
1 answer

Test that an expected Exception was thrown in Io

Is there an idiomatic way, that does not duplicate code and checks that an exception was thrown in Io when unit-testing? So far: threw := false e := try(_method that should throw_) e catch(Exception, threw = true) if(threw not, fail("Should have…
kungfoo
  • 1,297
  • 1
  • 14
  • 27
1
vote
1 answer

Io string (Sequence) manipulation/formatting?

Does Io have built in methods that mirror the ord() and chr() functions in other languages (namely being able to take an integer and return the ASCII character associated with it, or take a string character and return the ASCII number for that…
MidnightLightning
  • 6,715
  • 5
  • 44
  • 68
1
vote
1 answer

method to treat string as Object name in IO?

In Io, there is a getSlot() method which allows you to convert a string to a slot reference, but is there something similar to get a reference to an Object? For example: myObject := Object clone myObject myMethod := method("Hello World!"…
MidnightLightning
  • 6,715
  • 5
  • 44
  • 68
1
vote
0 answers

Future works weirdly on my machine, is it a bug?

someCalc := method( wait(2) return 10 ) futureResult := @someCalc "waiting for result" println futureResult println "done" println I think this code should output waiting for result 10 done But it output waiting for result 10 done done My…
Jian
  • 13
  • 2
1
vote
1 answer

IO language: what is the difference between a message send, do and doMessage

Although there is a documentation available, I got more confused, rather then enlightened. Let's consider an example: I have a myObject instance, which has myMethod method and I call it from the lobby: myObject myMethod In this method's body…
artemonster
  • 744
  • 4
  • 27
1
vote
1 answer

Io language different behavior between interpreter and file execution

I am trying to create a new operator in the Io language, but I've noticed different behavior when I check my work with an interpreter versus file execution: ## Executing nand.io ########################## OperatorTable addOperator("nand", 10) true…
domt
  • 43
  • 1
  • 5
1
vote
1 answer

Creating a constructor, adding attributes and methods in the Io language

I was practicing on the Io language. Finding sources is so hard. As you know there is no class in the Io language. But we can create our classes with our needings. Anyway, let's say I want to be able to run this and create an Animal class. Animal :=…
Erdi İzgi
  • 1,262
  • 2
  • 15
  • 33
1
vote
1 answer

Set the value of an object from inside a method in Io

I'm trying to set the value of an object from inside a method. Here's an example: myObject := list(1,2,3,4,5) myObject drop := method( self := list() ) myObject drop myObject println //returns original object What am I doing wrong?
David D
  • 113
  • 6