The Io Language
iolanguage.com
iolanguage.com
* Io Has A Very Clean Mirror - http://web.archive.org/web/20080212010904/http://hackety.org...
* Lazy Bricks, Lazy Mortar - http://web.archive.org/web/20080430135919/http://hackety.org...
Unfortunately they're only available via WayBackMachine.
Other useful links:
* Io notes - http://iota.flowsnake.org/
* Io sub-reddit - http://www.reddit.com/r/iolanguage/
Unfortunately _why disappeared off the net and with it went (most of) his sites including this predominately Ruby blog site (Hackety.org).
Who knows perhaps it might get resurrected one day. But at least its not lost thanks to WayBackMachine.
BTW... All of _why's code was saved here: http://github.com/whymirror And among this you can find a small web framework he wrote in Io: http://github.com/whymirror/yown
Also I liked CoffeeScript version of the pamphlet: http://github.com/jashkenas/coffee-script/blob/master/exampl...
I did (for my own leisure) write Perl5 version of this pamphlet. As some point will also do Io & Perl6 versions methinks.
Person := Object clone do(
name ::= nil
greeting := method(
"Hello I'm " .. name
)
)
bob := Person clone setName("Bob") greeting
# => I'm Bob
bill := Person clone
bill greeting := "Yo"
bill greeting
# => Yo >>> class Person(object):
... def __init__(self, name=None):
... self.name = name
... def greeting(self):
... return "I'm %s" % self.name
>>> bob = Person("Bob")
>>> bob.greeting()
0: "I'm Bob"
>>> bill = Person()
>>> bill.greeting = "Yo"
>>> bill.greeting
1: 'Yo'Of course, this implies that Io would need a separate construct to get the value of a slot (e.g. bob getSlot("greeting")), while in Python you'd just use bob.greeting no matter whether greeting is callable or not.
http://www.iolanguage.com/scm/io/docs/IoTutorial.html
would also give a demonstration of what makes this language unusual (beyond syntax).
for io it seems like this might be some smalltalk-inspired message passing stuff:
http://www.iolanguage.com/scm/io/docs/IoGuide.html#Objects-F...
combined with concurrency:
http://www.iolanguage.com/scm/io/docs/IoGuide.html#Concurren...
but it's hard to tell at a glance.
fwiw, the haskell page does a great job of this: following the "why use haskell?" gives the classic quicksort example.
Instead of "quick stuff", I'd rather have a (possibly peer-reviewed) paper about the language.
the first question is: why should i care about it?
the next questions are about the details.
Io still doesn't even have releases which I find pretty disconcerting.
I sincerely hope they get point releases up. Can you imagine someone with a casual interest in the language being in love with the fact that they have to keep their own version up to date and review core code for inclusion in their "version"? What about libraries across those frozen versions? It's a recipe for disaster and it pains me to no end that it hasn't been done yet.
Io isn't very fast, certainly not in comparison to MacRuby or IronRuby - or even YARV. It doesn't do all too well against Python or any other scripting language either.
But, thats okay. The purpose of Io is (as I view it) to explore OO programming. And it is very good at that purpose.
I eventually switched to Lua, and I haven't regretted it for a second - it's dynamic and expressive, but still a mature, portable, and clean language.
http://pragprog.com/titles/btlang/seven-languages-in-seven-w...
...and it was the only language I hadn't seen anything of before. Interesting mix of paradigms, and very clean syntax, at least from the little I've seen of it. If any HNers have used it for a non-trivial project, would love to hear of your experiences please.
Io is by far my favorite language. Steve did a fantastic job of removing everything that isn't necessary from OO, leaving a simple and powerful language.
The downside of using Io is that you'll end up writing a lot of libraries yourself, since there isn't a large community yet.
It performs better than I expected - when I profile the code, Io is never the main consumer of the CPU; it is always the graphics first and secondarily the physics. Occaisionally I make a mistake in my binding library that makes the binding library itself consume too much CPU, but when I fix those bugs it goes back to profiling as the script using only about 4% - 5% of my CPU budget.
Also, fully translatable. Check out Hindi: http://github.com/olabini/ioke/blob/master/examples/multilan...
Here is Ioke's author view on its speed: http://olabini.com/blog/2009/01/iokes-need-for-speed/
I've been looking for a post-lisp for some time now, and while I find Clojure very entertaining, RH took making it a Lisp seriously. This constrains it from the complete and utter evil I can accomplish with Io.
However the implementation has caused me some headaches. For eg. some of the Addons have dependency issues and I could never get the VM to compile at all on my Apple Powerbook (PowerPC). Also be the VM is very slow (for an example it is slower than Ruby 1.8).
But overall I came away with positive feelings about Io and I am definitely keeping my eye on it.
Here is a fun FizzBuzz I wrote:
for (n, 1, 100,
fb := list (
if (n % 3 == 0, "Fizz"),
if (n % 5 == 0, "Buzz")) select (isTrue)
if (fb isEmpty, n, fb join) println
)Lua also does prototype-based OO* , and is quite a bit more mature (and performs better, etc.). I've been using that instead, and I'm quite happy with it. (It also plays verrrry nicely with C.)
* Actually, it's more general than that - Lua has extensible semantics (via metatables). Setting up a prototype-based OO system is dead easy, and is a bit of a cliche example for how metatables can be used.