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
4
votes
4 answers

Reading in a file in io programming language

I'm looking to read in a simple text file using the IO language and print it to the screen, so far I have: f := File with("test.txt") f openForReading but just have no idea how to print it or clone the contents to an object. If anyone knows…
user3047190
  • 319
  • 2
  • 7
4
votes
1 answer

Color codes in Io

Is there a special trick to getting Io to switch the colors of terminal text? In Python I can run print "\033[0;34;40mHi!" and get a blue "Hi!". In Io, "\033[0;34;40mHi!" println seems to have no effect.
exupero
  • 9,136
  • 8
  • 47
  • 63
3
votes
2 answers

What's the significance of self inside of a method?

I'm reading through Seven Programming Languages in Seven Weeks, and one of the problems states: How would you change / to return 0 if the denominator is zero? I first tried defining my own / and proxying its implementation to the original / method…
Josh
  • 68
  • 4
3
votes
1 answer

How do I deserialize objects in Io?

I've found the serialized and justSerialized methods on Object and already successfully serialized objects to files, but I cannot find a matching deserialize method. Is there none or am I just too stupid to find it?
Kutzi
  • 1,295
  • 1
  • 15
  • 19
3
votes
1 answer

In the Io language, how can you see the implementation of "if"?

I was poking around some of Core and Object using "getSlot("method name") to see how some foundational methods were implemented. I was curious about how the if method was written and tried Io> Object getSlot("if") ==> Object_if() Io> Object…
labyrinth
  • 13,397
  • 7
  • 35
  • 44
3
votes
1 answer

How does scope work in Io?

I'm not quite sure how variable scope works in Io. The docs say it has closures, but I don't seem to be able to see idx from within the next and prev methods. Parent visibility is the key premise of closures, so how can they work? List iterator :=…
Dan Prince
  • 29,491
  • 13
  • 89
  • 120
3
votes
3 answers

Using Future throws `Scheduler: nothing left to resume so we are exiting`

I'm playing with Futures in Io. I have some methods that do some work: a := method(10 + 20) b := method(20 + 30) c := method(30 + 40) And I want to run them concurrently. This works as expected: m := method(list(@a, @b, @c)) f := @m writeln((f…
Dave Nolan
  • 3,009
  • 4
  • 30
  • 32
3
votes
1 answer

Io Language Basics

I am working on a project on the Io language. There is very little documentation on the language. I was hoping that some of you would have input on the following: Single Dispatch Multiple Dispatch Arity Overloading Type Overloading Property…
3
votes
2 answers

How can I enter multiline methods in the interactive Io interpreter?

I am trying the following sample from 7 Languages in 7 Weeks: Object ancestors := method( prototype := self proto if(prototype != Object, writeln("Slots of ", prototype type, "\n---------------") prototype…
Jedidja
  • 16,610
  • 17
  • 73
  • 112
3
votes
1 answer

Io: How to instantiate a subclassed primitive (e.g. Number)?

In the book 7 Languages in 7 Weeks there is a question: How would you change / to return 0 if the denominator is zero? Thanks to the thread What's the significance of self inside of a method? I have a working solution, but I wanted to try to do it…
3
votes
2 answers

io Assignment Operator not evaluating?

OperatorTable addAssignOperator(":", "myAssignMethod") "foo" : "bar" That gives an error that a Sequence does not respond to ":" (":" is still being treated as a message, not an operator). I think it should get evaluated to myAssignMethod("foo",…
MidnightLightning
  • 6,715
  • 5
  • 44
  • 68
2
votes
1 answer

How do I apply a dynamic list of arguments to a block in Io?

I'm writing a unit test framework (IoCheck). There will be a forAll method which accepts a property, such as isEven, which returns whether an integer is even, and a list of generators list(genInt). The syntax will look like this: isEven := block(i,…
mcandre
  • 22,868
  • 20
  • 88
  • 147
2
votes
1 answer

Random value bug in Io

I'm writing a unit test framework that will supply random integers, booleans, characters, and strings to test functions. Github repo: IoCheck. Code in question: genChar := method( Random value(128) floor asCharacter ) genSeq := method(gen, …
mcandre
  • 22,868
  • 20
  • 88
  • 147
2
votes
1 answer

Io Language fails to build: Foundation/Foundation.h: No such file or directory

I'm trying to build that Io language from source on Ubuntu 10.10 and not having a great deal of success. I cloned the repo, I navigated to the build/ directory, I executed "cmake ..", it seemed to go okay, I executed "sudo make install" and it fails…
Samwhoo
  • 312
  • 1
  • 8
2
votes
1 answer

Problems with Io Addons under Cygwin

Has anybody managed to use Io addons like Regex or OpenGL under Cygwin on Windows 7 32 bit? Notes: If it happen to be an ASLR issue, I want to keep ASLR enabled, so I did not test with it turned off. My Cygwin is a newer one, but not neccessarily…
Tino
  • 9,583
  • 5
  • 55
  • 60