Other Languages

Objective-C and Java are the two languages most commonly used with Cocoa, but many other languages operate with Cocoa to varying degrees. The languages used with Cocoa fall into two major categories: languages based on C and scripting languages.

ANSI C and C++

As mentioned previously, Cocoa is written in Objective-C, which is based on ANSI C. As a result, other languages that are based on C can be used with Cocoa. There are two strategies for using languages based on C with Cocoa. One strategy is to use only the C interface to the Objective-C runtime and a standard C or C++ compiler. The other is to use an Objective-C or Objective-C++ compiler to compile C or C++ code.

It is possible to write an ANSI C program that uses most ...

Get Cocoa® Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.