Tuesday, June 28, 2011

[Insert clever play on the name Io]

And so goes the second week and the second language on our seven week trip. Compared to the first week in Ruby, I struggled a lot more with Io. It's a language with very simple rules which, for me, made the edge cases all that more confusing. I also was a bit preoccupied with other, unrelated issues and so I skimped on a lot of the examples. Thankfully, Alberto did a lot of that work and wrote about it in a series of excellent posts. If you want to know more about Io, you should really read those.

As such, I'm going to keep it short with my own observations. As an abstract, Io is a prototype based OO language where everything is either an object or a message passed to it.

  • I was unable to build Io in Windows and I don't know what I would've done if I hadn't found some forum posting with a link to pre-built binaries. 
  • I particularly liked the way conditionals were also just messages, apparently just extending the base boolean types
  • Yet I don't really understand message precedence and how something like self sum / self size works. self size obviously gets evaluated before being passed to the divide operator, which I didn't expect
  • getSlot('foo') code print will print a method definition, similar to Javascript's foo.toString() (where 'foo' is a method/function)
  • sadly, that is not usable for the language constructs as they are written in C
  • Io has a pretty solid concept of coroutines, actors and futures, much unlike Javascript. Quickly writing some parallel code might indeed be one of the languages strong points
It seems the book deliberately started with Ruby to ease me in and then started to get a bit more challenging with Io to progress to Prolog, which I guess will be quite a bit different from what I'm used to. 

I'm again grateful for our study group. Our little skype conference showed that I wasn't the only one struggling with Io and I'm not sure I would've gotten much out of this chapter if it wasn't for other people's blog posts further explaining things. This isn't really a failure of the book as much as I just wasn't able to commit the time to really dig into the examples.

And now it's on to Prolog, which should get interesting, as I haven't worked with logic languages before. This time, installation is easy, as there is a package in cygwin that provides the 'pl' executable. (And, once again, let me recommend also getting mintty.)