Steve Dekorte's Io Programming Language
By Canol Gökel - Posted on June 18th, 2008
Tagged: io programming language
• steve dekorte
I met Io programming language a few weeks ago. It is very simplistic, minimalist and has a consistent syntax. It is a fully object oriented language inspired by Smalltalk. A significant difference from Smalltalk is that it is prototype based, so there are no classes.
To name a few advantages and disadvantages:
Advantages:
- Very consistent syntax
- Very minimalistic rules
- Has a lot of useful methods that makes your life easier
- Very polished source code
- Very informative and polished errors
- Chic documentation
Disadvantages:
- I like the writing style:
"Hello" at: 1 put: "a"
instead of
"Hello" atPut(1, "a")
Because it is more human like.
- Indexing begins from 0 not from 1.
- I don't like when a language does not want you to declare your variables before usage. I think declaring obligatory provides some kind of documentation to the user of a program.
- Some methods does not behave what you would like it to. For example, when you write
"Hello" at(1)
You get the byte representation and not the letter itself.
- Resulting elseif structures look a bit ugly.
- No GUI library bindings yet
Of course these are all subjective.
I think the worst disadvantage is that it does not have GUI binding yet. But once it has, then it will be a killer programming language.

I also have a love/hate relationship with Io. I adore its minimal-to-the-extreme syntax and its complete lack of reserved words. (if, while, true, etc. are just bindings.)
Some things I dislike, though are:
+ Types are identified by a string. Ask for something's type, you get a name.
+ Other than that, there is no concept of types. (A result of its being fully prototype-based.) So how would you have a visual browser that lets you CRUD methods? Would you show EVERY object in the system in your browser?
The big one for me, though is its performance. While runtime performance is certainly less important than development effort, performance is and always will have some level of value. Io seems tailor-made for rotten performance. It's un-optimizable. Why?
Everything is a message, even control constructs like if/while. This excellent idea taken from Smalltalk eliminates the need for reserved words. It's a good thing. But...
Io allows any binding to be rebound or overridden, including if, while, true, false, etc. I believe this is misguided. These are things you should never, ever do. The semantic of certain messages should be stable, reliable, including those control constructs, constants, and also Io's definers, method and block. If such things are redefined, the result is havoc. And the cost for allowing them to be redefined is too high. Hows that?
Every message is sent to an object. For the first message in a construct (as if, while, etc usually are), the receiver is the current object (self). The binding for any message, e.g. the thing that implements the 'if' message, can come from anywhere in the receiver's prototype chain. So even for such frequently-used and should-be-unchanged bindings, the entire prototype chain must be searched every time to maintain Io's semantics. This is the dynamic paradigm taken too far.
In the current implementation, prototype chain cycles are handled, but the same object (e.g. Object) can be searched multiple times if reached by multiple paths in the prototype chain. That's fixable w/o semantic changes, though.
All my other objections are fixable too, but only by changing language semantics. The result would have Io syntax, but it wouldn't be Io. Still, in MY opinion, it would be an improvement.
Previously I wrote that the receiver of the first message in a construct is the current object (self). I "misspoke". I believe it's actually the current context which holds local variables. Its prototype is any outer context, and the chain eventually leads to the current object.
> I like the [Smalltalk] writing style
If you like Io enough, you could use the Parser package in GST to translate Smalltalk to Io.
> I don't like when a language does not want you to declare your
> variables before usage. I think declaring obligatory provides some
> kind of documentation to the user of a program.
More important than that is that you are declaring a scope. For example, this Python
tree_reducewon't do what you want:def tree_walk(proc, tree): for node in tree: if isinstance(node, (list,tuple)): tree_walk(proc, node) else: proc(node) def tree_reduce(proc, tree, init=None): def visit(node): init = proc(init, node) tree_walk(visit, tree) return initbecause an unwanted scope is magicked into existence.
> You get the byte representation and not the letter itself.
If it doesn't have a character type distinct from the integer type, then this is the right thing to do, not answer a string of one character.
Everything has a true or false value. This will lead to obscure bugs. I think this is one area where Smalltalk got it very right... if you want anObject asBoolean, you write the method explicitly.