CSC302 2011S Programming Languages

Reading: Io (3)

Reading: Tate 3.4 (The Parade and Other Strange Places) and 3.5 (Wraping Up Io).

Please either (1) submit a good question on Piazzza by 9 p.m. on Sunday, 6 February 2011 or (2) respond to one of the questions by 10 p.m. on Sunday, 6 February 2011.

If you submit a question, please tag it #io3.

SQ: The examples given for coroutines and actors don't seem to differentiate the two concepts very well; assuming that actors provide more functionality and safety than coroutines, in what situation would one benefit from using coroutines instead?

IC: Good question (check plus), but late (check)

SQ: When reading the curlyBrackets code, I was confused when Tate said that the parser knows to call this method when it sees "{}", as I couldn't find that explicit assignment (there are literally no curlybrackets in that method). Turns out that Io does recognize the string "curlyBrackets" as {}.

Io> {}

  Exception: Object does not respond to 'curlyBrackets'
  Object curlyBrackets                 Command Line 0

I was wondering if anyone else has found similar shortcuts (Io land puts a pretty high tariff on sugar it seems..)

IR: Square brackets work that way, too. You can also create your own operators, like +-* (all as one thing.)

IC: Good question [plus]

SQ: I still don't understand how certain things work step-by-step in these big code lines. For instance, call message arguments foreach( ...). I understand what that does, but I don't understand how each of those words functions or is parsed.

IC: Good question [check plus], but anonymous

SQ: I haven't really worked with concurrency in any language, so I have no reference with which to evaluate IO's handling of concurrency. What are the advantages of IO's concurrency handling, and how does this compare to most other languages' handling of concurrency?

SQ: Why is Io called Io? As far as I can tell it is impossible to find out stuff about it using search engines. Is there secret sauce for finding stuff about Io in Google? The term is used so frequently that I've yet to come up with any. Many of these questions seem trivial to answer with a quick Google search, or would be if Io was named something reasonable. This is starting to drive me a bit crazy.

SQ: In io, are there any objects that might act as semaphores or mutexes when implementing multithreaded programs?

IC: What makes you think that your colleagues are any better at Googling or reading the documentation than you are?

SQ: Tate spends a good amount of time describing how small of a footprint Io has, but how does it catch asynchronous messages and convert them to actors while keeping a low foot print? From what I understand, predicting deadlocks and race conditions is a difficult task.

SR: Based on the text's description of Io's concurrency system, I think it has been engineered to avoid many of the problems that you encounter with threads. For example, according to the book, "Futures in Io also provide automatic deadlock detection."

If the implementation is clever enough, it may not need much overhead to manage this feat. However, as SamR said, I can't tell you if the implementation is all that great without more study, but it could be. [IC: Check plus on the response]

IR: I'm pretty sure that Tate overstated Io's capabilities.

IC: I said the first week of class: I don't know the details of language implementations. So, neither I nor your colleagues are going to be able to answer this question any better than you can (e.g., by a careful Google). [Check minus]

SQ: Could we talk about the example where we print out XML by overriding the forward method? I didn't understand the code.

IC: A nice, straightforward question. (Of course, I wish you had not changed the example that you did not understand.)

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Mon Feb 7 08:49:10 2011.
The source to the document was last modified on Mon Feb 7 08:48:11 2011.
This document may be found at

You may wish to validate this document's HTML ; Valid CSS! ; Creative Commons License

Samuel A. Rebelsky,