Thread: Io?

    #1
  1. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69

    Io?


    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.

    Code:
    Io> sayWhat := for(i, 1, 5,
    a->                 "Hello DevShed!\n" print)
    Hello DevShed!
    Hello DevShed!
    Hello DevShed!
    Hello DevShed!
    Hello DevShed!
    
    ==> Hello DevShed!
    
    Io> sayWhat
    
    ==> Hello DevShed!
    
    Io>
    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:

    impressive

    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).”


    http://www.iolanguage.com/

    Take care,

    Mark.

    Comments on this post

    • SimonGreenhill agrees : interesting, thank you
    • Schol-R-LEA agrees : Thank you, I'll take a look when I have a chance
    programming language development: www.netytan.com Hula

  2. #2
  3. fork while true;
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2005
    Location
    England, UK
    Posts
    5,538
    Rep Power
    1051
    it reminds me a touch of prolog, though not mentioned. It definitely rings of smalltalk, and i'm sure there's a little haskell in there too.

    interesting idea, and i'll definitely take a look, but i don't think it's going to displace ruby or gcl right now as my favourite languages.
  4. #3
  5. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Originally Posted by LinuxPenguin
    it reminds me a touch of prolog, though not mentioned. It definitely rings of smalltalk, and i'm sure there's a little haskell in there too.

    interesting idea, and i'll definitely take a look, but i don't think it's going to displace ruby or gcl right now as my favourite languages.
    I can't see any strong relationship there. You mean syntax wise?

    Prolog is a logical language, and any Haskell program will be full of the usual -> and other symbols such and patterns. You also don't get things like reassignment and what not. Maybe I'm just not seeing what you're seeing .

    I think IO it has a lot of very nice points, especially for such a young language:

    Simplicity is a must.
    Powerful Concepts.
    Flexibility.

    All of these IO has in an abundance of all of these things. Features like regular expressions and closures, a very fast growing set of libraries etc. All make it look quite appealing.

    The fact that it's so easy to embed has to be a big win.

    I'd say it has the capacity to run with the bigger older languages. Both Ruby and IO are very nice languages but IO is by far the simplest to learn and most flexible.

    All of these qualities could make it better for a number of applications.

    As a platform for learning languages like Smalltalk etc. it's also very handy .

    It doesn't replace Scheme in any sense of the word but its still very nice to play with.

    Enjoy,

    Mark.
    programming language development: www.netytan.com Hula

  6. #4
  7. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    I really don't feel like making some extensive post on the pros to using IO. But here are a few I received without even touching the language:

    Makes good use of various libraries. Such as OpenGL, FreeType, and some hashing algorithms.
    Supports ANSI c.
    It has a beautiful syntax to it, I'm sure the feel of programming in it is also gratifying.

    I recommend everyone take some time out to look deeper into this language. Don't be afraid to try something new. I'll be testing this as soon as I have some more free time.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2005
    Posts
    60
    Rep Power
    10
    I was at the website few months ago. It is fairly new though (came out in 2005 i believe). I do hope it gains momentum. It is faster than python too.
  10. #6
  11. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    Originally Posted by play_
    I was at the website few months ago. It is fairly new though (came out in 2005 i believe). I do hope it gains momentum. It is faster than python too.
    I wouldn't go as far as directly stating that IO is faster than Python. As the main page says, it is "comparable" in speed. Take a look at the following link:

    http://www.iolanguage.com/about/speed/basic/x86/

    In some areas IO defeats Python, but in others Python blows IO out of the water. I'm not implying that IO is slow by any means, but not once on that page does IO completely surpass Python. That page only measures their speeds at a basic level, and on an x86. If you look at:

    http://www.iolanguage.com/about/speed/vector/x86/

    You will notice that IO wins over Python in nearly every test. These tests are more complex tests done with the two languages, and it seems that IO performs them overall faster than Python does. They used Python 2.3.5 for the test, I'm not sure what difference, if any, would occur speed-wise if they used the latest stable version.

IMN logo majestic logo threadwatch logo seochat tools logo