Why not Io?


I have been asked a few times in different circumstances why I feel the need to create my own language instead of just working with Io. That is a very valid question, so I’m going to try to answer it here.

First of all, I like Io a lot. Ioke is close enough to Io that it will be obvious who the parent is. In my mind at least, the differences are in many ways cosmetic and in those that are not it’s because I have some fairly specific things in mind.

So what are the main differences? Well, first of all it runs on the JVM. I want it that way because of all the obvious reasons. The Java platform is just such a good place to be. All the libraries are there, a good way of writing extensions in a language that is not C/C++, a substrate that gives me threads, GC and Unicode for free. So these reasons make a big difference both for people using Ioke, and for me. I want to be able to use Ioke to interact with other languages, polyglot programming and all. And since I expect Ioke to be much more expressive than most other languages, I think it will be a very good choice to put on top of a stable layer in the JVM. Being implemented in C makes these benefits go away.

Of course I could just have ported Io to the JVM and be done with it. That’s how it all started. But then I realized that if I decided to not do a straight port, I could change some things. You have seen some discussions about the decisions I’m revisiting here. The whole naming issue, handling of numbers, etc. Other things are more core. I want to allow as much syntactic flexibility as possible. I really can’t stand the three different assignment operators. I know they make the implementation easier to handle, but having one assignment operator with pluggable semantics gives a more expressive language.

Another thing I’m adding in is literal syntax for arrays and hashes, and literal syntax for referencing and setting elements in these. Literals make such a difference in a language and I can’t really handle being without it. These additions substantially complicate the language, but I think it’s worth it for the expressive power.

A large difference in Ioke will be the way AST modification will be handled. Io gives loads of power to the user with regard to this, but I think there is more that can be done. I’m adding macros to Ioke. These will be quite powerful. As an example, the DefaultMethod facility (that gives arguments, optional arguments, REAL keyword arguments and rest argument) can actually be implemented in Ioke itself, using macros. At the moment this code is in Java, but that’s only because of the bootstrapping needed. The word macro might be a bad choice here though, since it executes at the same time as a method. The main difference is that a macro generally has call-by-name/call-by-need semantics, and that it will modify it’s current or surrounding AST nodes in some way. Yes, you heard me right, the macro facility will allow you to modify AST siblings. In fact, a macro could change your whole script from that point on… Of course Io can do this, with some trickery. But Ioke will have facilities to do it. Why? Doesn’t that sound dangerous… Yeah. It does, but on the other hand it will make it really easy to implement very flexible DSLs.

A final note – coming from Ruby I’ve always found Io’s libraries a bit hard to work with. Not sure why – it’s probably just personal taste, but the philosophy behind the Io libraries seem to not provide the things I like in a core library. So I will probably base Ioke’s core library more on Ruby than on Io.

There you have it. These are the main reasons I decided to not use Io. And once I started to diverge from Io, I decided to take a step back and start thinking through the language from scratch. Ioke will be the result, when it’s finished. (Haha. Finished. Like a language is ever finished… =)


4 Comments, Comment or Ping

  1. Thanks for the explanation, Ola. If I were to fork Io, I would probably do it for the same reasons you mention. :-) The lack of a literal syntax in Io for lists and hashes is annoying (coming from Ruby or Python), but I understand the benefit is that means Io allows you to (re)define what ‘[‘, ‘]’, ‘{‘, ‘}’ means to you in a very Lispy way that other languages don’t allow. And yeah, having to say “a := 1” for assignment, but “a = 1” for updates is annoying, too. Anyway, good luck with the implementation and I’m looking forward to seeing Ioke’s first “killer app”. :-)

    October 6th, 2008

  2. matthias

    > The main difference is that a macro generally has call-by-name/call-by-need semantics

    Haven’t you decided whether you want call-by-name or call-by-need? In a language with state you definitely want call-by-name. You can allays implement call-by-need on top of it easily.

    call-by-name: you can evaluate the expression whenever you want how often you want.
    call-by-need: the expression is evaluated the first time it’s needed and than the result is cached (at least in a non-pure language).

    October 7th, 2008

  3. Matthias:

    Oh, I want both, I’ve decided that. And I know that call-by-need is easily implemented in terms of call-by-name. I just haven’t decided on the specifics yet. But it will not be a lazy language in general, though.

    October 7th, 2008

  4. Good choices, in my opinion! You’ve kept the things I like best about Io, especially powerful reflection, basic syntax, and prototypes/mimics.

    December 26th, 2008

Reply to “Why not Io?”