Objective C vs C for kernel space?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Re: Objective C vs C for kernel space?

Post by Colonel Kernel »

Although they have a very large common subset, C is not a proper subset of C++. C and C++ have actually been evolving independently for a while now. There are new features in C99 that are not in standard C++ (variable length arrays, "restrict" keyword).

Every feature of C is automatically available in Objective-C -- it is a strict superset of C.
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
User avatar
steveklabnik
Member
Member
Posts: 72
Joined: Wed Jan 28, 2009 4:30 pm

Re: Objective C vs C for kernel space?

Post by steveklabnik »

This is a fairly common misconception, because originally, C++ was a superset. Not anymore.

http://en.wikipedia.org/wiki/Compatibil ... nd_C%2B%2B

Sorry, I would have posted the link before, I just thought it was common knowledge by now.
User avatar
inx
Member
Member
Posts: 142
Joined: Wed Mar 05, 2008 12:52 am

Re: Objective C vs C for kernel space?

Post by inx »

syntropy wrote:Then I saw the runtime and how many ugly hacks were put to use just to make it work with obscure architectures and quickly put down that idea. Don't try it, believe me. It's horrid.
This depends on the implementation. It seems likely to me that you were looking at the GNU runtime, and from what I've heard,
the Apple(NeXT) runtime is much cleaner. The Apple runtime is also open source, although I don't know that the license
would be agreeable. Both of those options aside, if you're starting from scratch, you could make it cleaner than either. I doubt
that the ugliness in the current implementation is strictly due to the language itself.
Post Reply