Hacker News new | past | comments | ask | show | jobs | submit login
Io language (iolanguage.org)
124 points by polskibus on Jan 10, 2015 | hide | past | web | favorite | 40 comments

This is one of the languages covered in the excellent Prag Prog book "7 Languages in 7 Weeks" (https://pragprog.com/book/btlang/seven-languages-in-seven-we...).

It wasn't until I went through that books section on io and how prototypal inheritance works that I felt like I really started to get a handle on JavaScript.

There is a sequel to that book https://pragprog.com/book/7lang/seven-more-languages-in-seve... covering Lua, Factor, Elm, Elixir, Julia, miniKanren, and Idris.

There was a great interview with Bruxe Tate on the "Mostly Erlang" podcast some time last year. He discusses the decision process behind the languages that were included in the original "Seven Languages" book. From what I gathered, the reason Io was included was because Javascript is simply too complicated and multi-paradigm. The syntax and reasoning behind Io is extremely simply and illustrates prototypal principles beautifully.

It's never occurred to me to use Io for anything, but it's a wonderful mind expander.

Lua and IO are easily the two best ways to learn Javascript.

Once you know one, or both of them, you can see what's going on so much more clearly.

> Lua and IO are easily the two best ways to learn Javascript.

I think REBOL is a better way to learn JavaScript.

That's a great book. I credit it with getting me into functional programming.

IO has been around for a while now, I remember it got some press back when _why was still active:


I've played around with it a bit over the years: it is a fun little language.

Edit: fixed typo.

I'm fond of the post Lazy Bricks, Lazy Mortar¹ where he basically pulls a rabbit out of a hat. It's a shame he didn't write more posts about Io.

¹ http://web.archive.org/web/20080430135919/http://hackety.org...

I used Io as an embedded scripting language in a video processing app. That was something like 9 years ago. (Although Io's method dispatch is heavy, it worked fine even on G4 Macs as the performance-intensive parts were C functions anyway.)

Many years later I used Ruby, and I couldn't shake the feeling that Ruby had the same goals as Io but only got half way.

I like both Io and Ruby, but they have much different goals. The moderating qualities that make Ruby seem halfway there to you were an intentional design choice, because Matz wanted the language to feel familiar and friendly to programmers coming from other languages. Ruby also took a lot of good things from Perl (built-in regexes and other high-quality string processing facilities, especially) that helped it fit into the Unix scripting ecosystem in a way that purer languages like Io never would.

I would never consider embedding Ruby like I would Io or Lua (although mruby is promising); on the other hand, part of what helped me learn and stick with Ruby was using it for innumerable Unix scripting projects that would have been much more awkward in a language like Io.

(Io also suffers from Scheme's problem, where a minimalist language is more likely to calve a multitude of private and mutually incompatible frameworks.)

> Io also suffers from Scheme's problem, where a minimalist language is more likely to calve a multitude of private and mutually incompatible frameworks.

I think that could be addressed in exactly the way Ruby addresses it, by having a popular leading framework. Although in Io's case there are some gaps in the standard library that I think need filling. For example, there's no reason it has to be painful to do Unix scripting.

Another consideration is that frameworks in Io don't need to be brought into conflict. It's still a trap, but it can be navigated and I really don't think the situation is any worse than Ruby's.

I haven't seen the Scheme problem in Io's frameworks. People tend not to invent new control structures or object models because Io provides powerful and more consistent one's already.

Convenient timing, I just started working on a project to pull my Io DSLs and convenience protos into something more cohesive. So, plug: https://github.com/smosher/IoSetting

Included are DSLs for List and Map construction, homoiconic pretty-printers for List and Map and a few other things. I plan to do a lot of work to make List nicer to use, plus some experimental constructs for... experimental things.

I was going to wait until this got a little more mature before mentioning it anywhere, but I figure I should mention it in this thread.

Looks a good start.

I had plans for doing something like this a few years back myself. Here's the only bit I managed to put on Github - https://github.com/draegtun/Io-Array

Nice. I had seen some list-indexing uses of squareBrackets before. This looks interesting, also reminds me I should write tests.

If you want to play around a little bit with Io, we have an experimental Io mode on CodeCombat, so you can play in your browser: http://codecombat.com/play

If you want to play around a lot with Io, you could help us extend the parser so that it doesn't break after level 10. :P https://github.com/dariusf/iota

I heard something about Io being used in rendering pipelines for a film studio (Pixar?).

The '7 languages in 7 weeks' book exposed a lot of people to Io, and it really helped me understand JavaScript better at a time when most of the tutorials out there were pretty confused

From what I've been told, Pixar uses Io as an embeded scripting language for their IT (Image Processing) application and for some build systems.

Honest question: What are the main selling points of Io ? If I wanted to compare its strengths and weaknesses against Go, Rust or even a less popular language like Nim, where could I find that out ?

It doesn't make much sense to compare it to any of those languages, it doesn't try to solve the same problems. Io is a minimalist's scripting language in the same space as Python, Ruby and Perl. It's also very suitable for embedding, like Lua. It aims for a performance profile similar to Python's, which sets it apart from some high-performing high-level languages like Lua, Javascript, Java, Scala and Go.

Its incremental GC makes it somewhat suitable for game scripting. It uses a single OS thread with coroutines, like Lua, although it supports multiple VMs in the same process, so asynchronous message passing between two VMs on separate threads might be easy enough to hack together.

It's good for people who like the minimalism and dynamic nature of the language and what it lets them accomplish, so long as their task isn't CPU-bound and doesn't require a rich library ecosystem.

Lua supports multiple VMs in the same process too (there are no globals, you always pass the Lua state).

New languages are research projects, not startups. They don't really compete against each other.

Generally if you're asking this question then you should just stick with the more well-known platforms.

Languages themselves don't have strengths and weaknesses. You need to compare everything else along with the language, the community, library support, stability of the implementation. And if you're looking for a comparison of these in a brand-new language, what you're looking for is not something it can offer. There is no community, libraries will be extremely spotty and not well documented. You also need to know the language it's implemented in, too, because you might need to debug the odd bug in the implementation yourself.

As someone who loves Io, it gets my attention because:

— the language is very mutable, almost all behaviours can be modified

— it's simple, all you can do is send messages to objects

— you can write DSLs and macro-like things without special macro support

— it's so dynamic you'll end up live-coding without realizing it

It has less syntax than Smalltalk, it's homoiconic like Lisp, but doesn't need support for macros because of the way messages are handled.

A not intolerable way of thinking of Io is it is to object calculus what Lisp is to lambda calculus. There are parts where that analogy breaks down but it's not a bad first approximation.

edit: formatting

It's slow as balls and the design/features mean it will always be very slow.

I don't think Io's feature make it necessarily slower than, say, Self, and that could be quite fast (the methods-can-be-macros should be statically manageable, I believe) .

Io's an attempt to combine the language minimalism of Smalltalk and Lisp. So you get a message-passing object oriented language with Lisp-like features like programs being their own parse tree, which you can manipulate at will at runtime.

Apparently it's supposed to be really fast, too, for a pure-interpreted language, but unfortunately the name 'io' is unsearchable and I haven't found any references. (I think this is a major factor why nobody's ever heard of it.)

> unfortunately the name 'io' is unsearchable

As with Go, appending 'lang' gives more luck: https://google.com/search?&q=iolang. (I still didn't find a reference for the speed, though.)

Io's speed has improved a lot historically, but due to its dynamic nature, it has a relatively high dispatch overhead, and little of what remains can be optimized away. In the past, GC was a big bottleneck, not sure where we are today on that front.

Io is no speed deamon, but for heavy computation, its easy to dip into compiled C or C++ libs, putting it in the same ballpark as an unjitted ruby, python, or lua.

What adrusi said is very spot on. I would add to what he said: Io is one of the few homoiconic languages that is not a Lisp. If you know what this means and what power this offers, I would argue this is a main selling point. If you don't know what this means or why this matters, it will be a meaningless differentiator.

AFAIK, Io isn't the kind of language to be compared with Go & co. - I don't think performance is one of its strong points. Rather it is a light and embeddable language, kind of like Lua.

Io and Lua are light and embeddable but while Io is much slower than Go (and much higher level), I suspect Lua is probably the fastest scripting language around and LuaJIT may be competitive (perhaps even faster) than lower level garbage collected systems languages like Go and Java.

Looking back, I wish I had written Io in Lua.

I've actually went to the Wikipedia to look up, who the creator of Io was. :)

No, seriously, thank you for creating it. Although I hadn't had the chance to use it in production (most of my stuff is just numerical), Io is an incredibly enlightening language.

I honestly wouldn't suggest it for production code, but I think that learning it gives you a great perspective on how powerful the right simple basic constructs can be.

So learn it to be a better programmer.

I don't know how true it is, but the language author claims that it made it into space, on board of some satellite or spacecraft. If that doesn't make it "production ready" then I really don't know what would.

The page is confusing. Here is an example https://github.com/stevedekorte/io/blob/master/samples/misc/...

How to make better landing page -> http://www.rust-lang.org/

Surely it's unfair to expect the GitHub page for a language, much less some deep-linked sub-page of it, to be a professional landing page? The page linked from the post, iolanguage.org, is (intentionally) minimalist, in the spirit of the language, but still a reasonably good landing page. (Also, as near as I can tell, although it contains a link to GitHub, under 'source' where one would expect, it contains no direct link to the page that you provide.)

I don't expect "professionalism" or beautiful design, but give me the good stuff first (use cases, samples).

Only one click away from landing page is the Io Programming Guide. I've always thought it was a well written introduction to Io - http://iolanguage.org/scm/io/docs/IoGuide.html

I didn't mean to argue about the virtue of the actual landing page (it doesn't 'sell' the language, but I'm fine with that), only of tying your complaint to a GitHub page rather than the actual landing page. (Was it maybe an errant cut-and-paste?)

I agree with the parent. Upon encountering the page, my first feeling is that this is one of THOSE landing pages.

Of course, I know this is just me bringing my biases to the thing, but that's the way it is.

Applications are open for YC Summer 2020

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact