points by mrpippy 10 years ago

DriverKit was the NeXTSTEP 3 driver environment, and it was written in ObjC.

In old mailing lists posts (https://www.geeklair.net/~dluke/PCIdevice_tutorial.txt), Godfrey van der Linden (one of the IOKit architects) made some comments about the IOKit language choice:

  As IOKit is a child of DriverKit which was implemented in ObjC we 
  wanted to reduce the amount of work necessary to convert from one 
  space to the other, as ObjC is single inherited this was easiest for 
  most of our drivers.  At first we were going to allow multiple 
  inheritance as we ported to C++ but then we tripped over the whole 
  can of worms called 'virtual' inheritance.  We really, really didn't 
  want to turn all of our developers into C++ experts, which you have 
  to be to use virtual inheritance properly.  Another side effect is 
  that we are now reasonable language independent.  At some stage in 
  the future we may be able to move IOKit over to a good programming 
  language.

I suspect that if they had re-written IOKit in 2010, it would be in Objective-C. My guesses why it was done in C++ in 2000:

- programmer familiarity/comfort level: remember that classic Mac development was mostly being done in C/C++ by the mid-90s, and the Mac developers still around by 2000 didn't need to be given more reasons to jump ship. Carbon was created so that Mac C/C++ applications could be brought to X, and having drivers written in C++ was another easing factor.

This also includes Apple's internal development teams--I don't think all the longtime Apple teams were that bullish on NeXT technologies. Remember that the original OS X Finder was a C++ Carbon app built with CodeWarrior.

- ObjC not considered inevitable: in 2000 it was not at all clear that ObjC would be thriving for another 15+ years. The C/C++ Carbon API was one direction for the future, the Cocoa-Java bridge was another, another was putting C++-style syntax on top of ObjC (which was never completed). C++ wasn't going anywhere, whereas it would be painful to have driver development handcuffed to ObjC if applications abandoned it.

- performance: it probably would have been a non-issue, but C++ is a safer choice performance-wise.

There might be other interesting tidbits on the darwin-development or darwin-drivers if you go back to 2000/2001.

ams6110 10 years ago

In 2000 or thereabouts there was a strong push towards Java.