The iPhone SDK, Objective C and Ruby

Labels: , , , ,

I bet many of you have already seen the iPhone SDK presentation already. I believe that many will be tempted by the platform. There are barriers for entry though. You have to do all development on a Mac, you have to have an iPhone (emulators are not for production testing), you have to be a partner in the Apple developer program and you have to write code in Objective-C.

Objective what? Objective-C is a language that sits on top of C++ C. It has some dynamic features and the syntax will instantly remind you of
SmallTalk. Actually I shrug to the idea of writing code that looks like SmallTalk with C++ like constructs. Sounds like sweet and sour Chinese food
to me (it reminds me of the ugly "new" operator that is off place in Javascript). But Apple has done a great job with Cocoa (the MacOS X interface toolkit) and CocoaTouch (the one designed for touch interfaces, iPhone, iPodTouch and soon iTablet). The API is very elegant and clean (I still yearn for the BeOS API though, will always do).

OK, what does this have to do with Ruby? Well, a very interesting project popped up in the Ruby core list recently. Apparently, Apple is integrating the whole of Ruby1.9 into the Objective-C runtime and it is calling the package MacRuby. Ruby code will have access to all Cocoa interfaces and vice-versa. This project is an open source one but is being spearheaded by Apple. All those actively contributing right now are Apple engineers. They are trying to expand the interfaces to their APIs and thus cater for more developers.

Will we ever see an iPhone shipping with MacRuby? Will we be able to write Cocoa Touch interfaces in Ruby? Imagine that, I will no longer be ashamed that I don't know shoes!

Comments (7)

Just a point of info: Objective C does not "sit on top of C++". It is a superset of C and is a peer of C++, if anything. Anything you can write in C you can write in Objective C as well, but C++ is its own beast with its own OOP model. Apple provides 3 compiler front ends with MacOSX: C, Objective C and C++.

Note for pedants: It is technically possible to combine all three with something called "ObjC++" (Objective C++), but its usage is rarely seen and probably for good reason (the resulting code can be highly confusing and pleasing to none of the folks who love C, C++ or ObjC).

A good starting point for becoming an xcoder

http://www.cocoalab.com/?q=becomeanxcoder

Sam

You need to fix the huge mistake in your post , Objective C is a superset of the C language not of the C++language.

The superset of the C++ language is named Objective-C++ and it is not a language that you can code iphone or osx apps in , you can only use it with a GCC compiler.

Don't take my word for , quote from http://en.wikipedia.org/wiki/Objective_c "Objective-C is a very thin layer on top of C. Objective-C is a strict superset of C"

Thanks to anonymous guy and vlad, post is now corrected and sorry for responding too late!

Worth noting I've successfully used Objective C++ on OSX, for a preference pane which shared common code with a driver (written in C++). All worked fine :) No idea if it'd work on an iPhone, though, but I'd hope so.

For those who are interested in iPhone development using Objective C++, there's an article on our blog about this topic. It got some pretty interesting numbers concerning performance of Objective C versus C++ and iPhone versus desktop computers.

Making holic gold is the old question : Honestly there is no fast way to make lots of holic money . Sadly enough a lot of the people that all of a sudden come to with millions of holic online gold almost overnight probably duped . Although there are a lot of ways to make lots of cheap holic goldhere I will tell you all of the ways that I know and what I do to make holic online money.