Page 1 of 1

Implementing an Objective-C runtime

Posted: Sun Jan 20, 2013 4:33 pm
by Primis
I have an inclination towards objective-c as my language of choice. I see it as an excellent kernel level object oriented language, being a strict superset of C. However I have come across a problem. Since Objective-C is almost entirely dominated by Apple, (gnuStep is kinda there, but not really) there is NO documentation I can find for the runtime spec from the original language specification, hell I can't find a language specification. Any help on that would be nice.

As a secondary thought: what is the aversion to this? Am I missing a red flag of all this?

Re: Implementing an Objective-C runtime

Posted: Mon Jan 21, 2013 3:07 am
by Combuster
The thing to be especially wary about is that Objective-C uses runtime dynamic linking, and that initializing an Objective-C object is likely to depend on a full-blown memory manager before you even get to sending -(id)init.

Other than that, my method for porting runtime is just to drop it into your project, try building it, store the few MB of errors into a file and then go tackling the issues one at a time.

As far as specifications are concerned, there are quite a few bits and pieces hidden across developer.apple.com, but it's sadly for us mostly targeted at users, not implementers.

Re: Implementing an Objective-C runtime

Posted: Sat Mar 09, 2013 12:56 am
by Primis
As it would turn out, the Étolié Runtime from Carnegie Mellon, now shipping under the name "GNUStep-Runtime" which is part of the GNUstep project, is MIT licensed rather than the old GNU Runtime which was in fact GPL =D>
It also has been updated to modern obj-c 2.0 and supports all the things you'd expect from the OS x runtime, but slightly slower.
I guess digging deep helps sometimes. Who knew that GNUStep had MIT licensed code!

Re: Implementing an Objective-C runtime

Posted: Sun Mar 10, 2013 5:24 am
by malown
Hey,

Check out this project if you're looking for an alternative open implementation of the runtime https://webkeks.org/objfw/