Alex Payne

Writer, backer, erstwhile technologist.

C4-[1]: Tim Burks on "Bridges and Beyond"

Tim Burks previously worked on very low-level chip software. In the process of delving deep into computer technology and learning the gritty details he claims to have “lost a lot of heros.”

But Brad Cox, author of Objective-C, remains a hero of his, particularly for his paper “”Planning the Software Industrial Revolution“:http://virtualschool.edu/cox/pub/PSIR/”. Cox saw dynamic binding as essential for progress in the software industry, and Tim sees the need for a glue language beyond Objective-C. His requirements for a glue are reflection, interactivity, and expressiveness, all of which he found in Ruby.

To bridge ObjC and Ruby you can wedge libFFI between the two languages to bridge their respective method tables. Tim spent the first half of 2006 working with and documenting RubyCocoa, but ended up frustrated. He started working on RubyObjC, and overcame seven challenges in the process:

Message syntax is far different in ObjC than in most other languages.

Types have to be translated between the two languages.

Libraries have to be bridged (ex: NSDate to Ruby’s Date).

Object storage: each language has its own way of constructing and storing objects.

Memory management: GC can kick in when you don’t expect it.

Threading.

Namespace conflicts.

Tim goes on to demo a visual chip design application that was mocked up in Ruby with an interface in Cocoa. While parts of it have since migrated to ObjC, a Ruby console is available at all times. As he moves around a chip and traces paths between wires there are oohs and aahs. It’s really impressive stuff.

At this point, the talk veers to Tim’s latest project: Nu, an interpreted dialect of Lisp “written on, with, and for Objective-C.” He demos a simple blog editing app with an embedded Nu console, including language functionality that mirrors Ruby’s method_missing. More oohs and aahs. Colin Barret posted to the Twitter backchannel: “As a language nerd, this is getting kind of pornographic.”

As a further demo, we find out that the blog server that the blog editor is talking to is all written in Nu with CoreData behind the scenes. A choice quote: “[the server code] is not as bureaucratic and dictatorial as Rails.” Templates are written in an Erb-like syntax. All told, probably the most brilliant talk so far this weekend.