Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Objective-C used without Cocoa?

It seems that Cocoa seems to be the main platform for Objective-C. GCC (which Xcode uses) supports Objective-C so it must be available on a wide range of platforms.

Are there any notable cross-platform projects that use Objective-C but not Cocoa (or its open source cousin GNUStep)? Is it really used outside the Apple ecosystem?

like image 435
Joe Avatar asked Feb 19 '10 16:02

Joe


People also ask

What is Objective-C Cocoa?

Objective-C is the native language of Cocoa applications. It is an object-oriented superset of ANSI C, allowing the developer to include "plain C" statements and code into the program. Any ANSI C program is a valid Objective-C program.

Which is faster C or Objective-C?

Objective-C is slightly slower than straight C function calls because of the lookups involved in its dynamic nature.

Is Objective-C compatible with C?

Objective-C is an object-oriented programming language that is a superset of C, as the name of the language might reveal. This means that any valid C program will compile with an Objective-C compiler. It derives all its non-object oriented syntax from C and its object oriented syntax from SmallTalk.

Does Xcode use Objective-C?

Objective-C is an object-oriented programming language used by Apple since the 90. It combines the advantages of two earlier languages - C and Smalltalk. In 1996 Apple overtook NeXT, which developer tools would use Objective-C. These tools were later included in Xcode.


2 Answers

Objective-C has also been popular in the scientific and financial services communities. There are still many Objective-C based applications deployed in banking, mostly on the trading analysis front. A friend works on a nearly million line of code Objective-C based analysis and trading engine for which they have written their own class hierarchy from scratch.

At one point, one of the more popular Linux window managers was written in Objective-C. That was a few years ago and may no longer be the case.

The LLVM compiler also compiles Objective-C, including having full support for Blocks. It is quite portable, too.

There is also David Stes's Portable Object Compiler. It compiles Objective-C to C and uses a class hierarchy that is based quite directly upon the original ICPak class hierarchy from StepStone.

like image 99
bbum Avatar answered Nov 03 '22 01:11

bbum


It seems what you're asking is if Objective-C is ever used without Cocoa, or GNUstep, or Cocotron, or any API like them.

The answer is basically no. Without an API like Cocoa (or GNUstep, etc.), Objective-C isn't very useful. For example, without NSObject, retain and release wouldn't even exist. A ton of very important features are built into these APIs, so it's somewhat pointless to use Obj-C without one of them.

like image 31
andyvn22 Avatar answered Nov 02 '22 23:11

andyvn22