I always thought it was a compiled language. I'm curious where the confusion comes from...
– FrustratedWithFormsDesignerJul 19 '11 at 13:21

1

@Mako: Please explain where you saw that objective-C was interpreted. Please provide the quote or the link that confused you.
– S.LottJul 19 '11 at 13:26

3

Nitpicking: Interpreted/compiled is a property of the language implementation, not of the language (although with most languages most implementations fall into one category). And even then it's blurry - if you go by the strict, and correct, definition of compilation, even most dynamic/"scripting" languages are compiled - to bytecode, but still compiled.
– user7043Jul 19 '11 at 13:38

1

Languages are specifications, often in some document written in English (but some languages have formalized their semantics in more mathematical notations). Being interpreted or compiled is a property of implementations, not of languages.
– Basile StarynkevitchOct 3 '14 at 7:26

2 Answers
2

It is neither. Objective-C is a programming language. A programming language is an abstract concept. A programming language is a set of mathematical rules and definitions. Programming languages aren't compiled or interpreted, they just are.

Compilation and interpretation aren't properties of a programming language, they are properties of, well, a compiler or an interpreter (duh). Every language can be implemented by a compiler and an interpreter, and most languages have both compiled and interpreted implementations. In fact, the majority of modern language implementations utilize both an interpreter and a compiler in the same execution engine for maximum performance.

For Objective-C specifically, I know of three implementations: gobjc, clang and oscompiler, but a quick Google search turned up two more. Of those five implementations, three are compilers and two are interpreters.

great explanation thank you; one question what was your search query for google?
– manuelBetancurtJul 19 '11 at 14:21

2

Part of the question the OP is asking stems from the fact that Objective-C was originally run through a pre-processor (and not directly run through an interpreted or a compiler) which generated C code. This could then be either run through a compiler that generates native machine code, or interpreted in some form (aside: I built a C interpreter once, just for fun). For simplicities sake people do say "C is a compiled language" - which - though wrong - actually denotes that C usually runs through a compiler.
– Martin S. StollerJul 19 '11 at 14:34

4

So while C can obviously be interpreted, I think it is safe to say that the rationale behind the language is to allow for efficient compilation, yielding a run-time performance close to what you can obtain with assembler. Hence, interpreting C is possible (and even useful in some situations), but it is counter to the original intentions of the language's designers.
– MonoloFeb 20 '12 at 11:40

The Objective-C language defers as many decisions as it can from compile time and link time to runtime. Whenever possible, it does things dynamically. This means that the language requires not just a compiler, but also a runtime system to execute the compiled code. The runtime system acts as a kind of operating system for the Objective-C language; it’s what makes the language work. developer.apple.com/library/archive/documentation/Cocoa/…
– Muhammad HewedyMar 14 at 10:19

Some language specifications spell out that implementations must
include a compilation facility; for example, Common Lisp. However,
there is nothing inherent in the definition of Common Lisp that stops
it from being interpreted. Other languages have features that are very
easy to implement in an interpreter, but make writing a compiler much
harder; for example, APL, SNOBOL4, and many scripting languages allow
programs to construct arbitrary source code at runtime with regular
string operations, and then execute that code by passing it to a
special evaluation function. To implement these features in a compiled
language, programs must usually be shipped with a runtime library that
includes a version of the compiler itself.

I think clange (the main objec compiler) ship with a runtime library to achieve the dynamic nature of the objective-c the language.

Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).