Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Objective-C have a Standard Library?

Most somewhat modern programming languages have a standard library? It is my impression is that there isn't a decent sized standard library for Obj-C , rather that it relies mostly/all on Cocoa and that (plus people not wanting to use GNUstep) is why Obj-C is only used on macs)?

Is this true/to what extent? Are there any standard obj-c collections?

(note I haven't done any Obj-C programming and am not to likely to try it in the near future, I'm just curious). P.S. are there a any decent non-Cocoa/Gnustep Libraries? are they non-apple, are they open source, well documented?

like image 611
Roman A. Taycher Avatar asked May 14 '10 11:05

Roman A. Taycher


3 Answers

Contrary to Outis's answer, Objective-C was not originally developed at NeXT. NeXT adopted Objective-C as the language of choice in the mid to late '80s. Objective-C was created by Brad Cox and Tom Love at Stepstone in the early '80s.

Of relevance to the question, when Cox and Love created Objective-C, one of their primary goals was to build a language that could support fully componented software models. That is, you would be able to buy a software component from somewhere and plug it into your application to add functionality.

Out of this was developed ICPak 101 and, IIRC, 102 (or 201, I don't honestly remember), which was a bit of a standard library for Objective-C. It never really caught on.

Clearly NeXT and Apple have been the primary motivating forces behind Objective-C and, thus, today Cocoa's Foundation is the most popular standard library for Objective-C. It isn't the only one; there are still versions of the ICPak in active use and there are non-NeXT/non-Apple Objective-C projects that are actually quite large. As well, Objective-C continues to be used by a handful of projects on Linux, mostly via GNUStep.

In general, Objective-C is intended to be a simple and small language. Out of that comes relatively simple and small libraries (compare the size of, say, STL or Boost to Foundation).

If you search for "stes portable object compiler", you'll find David Stes's continuation of all that Stepstone did, including an ICPak implementation (again IIRC -- I haven't looked into this stuff in a long time).

like image 83
bbum Avatar answered Oct 20 '22 05:10

bbum


Since Objective-C is an extension of C (and a rather small one, at that), the C standard library is available. Other than that, the main library is whatever the platform provides, which basically means the original NeXTSTEP library and its descendents: OPENSTEP, Cocoa, GNUstep, the defunct Coconut. This is because Objective-C was originally developed at NeXT and was taken over by Apple. There isn't even an official standard these days, just Apple's documentation.

In my opinion, the lack of other libraries isn't the reason Objective-C is mostly used in Mac development, it's an effect of the latter.

like image 42
outis Avatar answered Oct 20 '22 05:10

outis


I think this section (philosophical differences between Objective-C and C++) of the Wikipedia entry covers this issue pretty well.

like image 1
David Gelhar Avatar answered Oct 20 '22 07:10

David Gelhar