I look at a lot of different languages. I do this not least because theyíre a good source of ideas and new ways of thinking about solutions. A new language called IO has caught my eye more than most.
It has to be the most flexible none Lisp that Iíve seen
It seems to be making a buzz in some circles deep down within the web but to be honest thereís nothing really new at first glace Ė there are a lot of interesting features and concepts from other languages, but this level of flexibility has been available in Lisp since the beginning.
Certainly since I first started using Lisp close to a year ago
Need I say that I think Lisp still does it better, but then I'm bias and I wont pretend I'm not.
Whatís impressive is that this isnít a Lisp. There are no s-expressions in sight and functional programming is definitely playing second fiddle
IO still manages to contort itself in ways that (Iím tempted to say lesser) languages like C*, Perl, Python and Ruby couldnít handle even after 5+ years of Yoga.
Itís also remarkably easy to pick up and understand immediately if youíve had prior experience and I suspect even if you havenít.
OO is an advantage here of course but its pretty simple.
Io> sayWhat := for(i, 1, 5,
a-> "Hello DevShed!\n" print)
==> Hello DevShed!
==> Hello DevShed!
If you remember there was a lot of controversy around the time that Ruby really hit the headlines regarding how it was purely OO, how everything was an object etc. and how that statement effected other supposedly purely OO languages.
Well, in new light I think Ruby may have to take a back seat for a while. Iíll leave that up to you
In Ruby itís said that everything is an object and thatís certainly true so far as I can see but Ruby like C*, Python and Perl etc. has statements like ďifĒ and ďforĒ to gum up the works.
Statements it turned out around 45-50 years ago are a major pain in the butt.
Obviously these arenít objects or methods (though they may map to them Iím not sure of the implementation details but thatís not important) and you canít treat them as such.
This is where IO steps in shy and coy with a pure and untainted glance
As the example above shows ďforĒ is an object in IO. This is similar to Ďeachí in Ruby... but ďifĒ is also a method in IO, and so is everything else.
Methods themselves appear to be objects in a wonderfully circular fashion. In a twist the root Object in IO is itís own progenitor.
What does this mean? The programmer can add new constructs to the language, or alter existing ones seamlessly. You could for instance build in a case or switch expression.
IO goes another step towards Lisp by giving IO programmerís access to the AST. This effectively means that you can (at least in theory) do with IO what you can with Lisp macros Ė less elegantly of course since IO code is not data but again:
IO definitely deserves some attention, and thatís my primary reason for bringing it here. That and Iíd like to hear your opinions on it after youíve taken a closer look.
Or before if your that way inclined :rollseyes:.
For people who don't like how Lisp looks but would love to see what can be done with real flexibility, or for anyone who likes prototype based OO IO is a must see.
It's already made me examine some of my opinions about OO in general
IO has a lot of potential as a scripting language and as a configuration language for embedded systems.
Check it out.
ďIo is a small, prototype-based programming language. The ideas in Io are mostly inspired by Smalltalk (all values are objects), Self (prototype-based), NewtonScript (differential inheritance), Act1 (actors and futures for concurrency), LISP (code is a runtime inspectable/modifiable tree) and Lua (small, embeddable).Ē