Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to know if Objective-C is an interpreted or a compiled language.

share|improve this question
I always thought it was a compiled language. I'm curious where the confusion comes from... – FrustratedWithFormsDesigner Jul 19 '11 at 13:21
@Mako: Please explain where you saw that objective-C was interpreted. Please provide the quote or the link that confused you. – S.Lott Jul 19 '11 at 13:26
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. – delnan Jul 19 '11 at 13:38
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 Starynkevitch Oct 3 '14 at 7:26
up vote 26 down vote accepted

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.

share|improve this answer
great explanation thank you; one question what was your search query for google? – MaKo Jul 19 '11 at 14:21
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. Stoller Jul 19 '11 at 14:34
Out of curiosity, would you mind linking me to an objective-c interpreter as I haven't been able to find one. – Joshua Nov 11 '11 at 7:03
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. – Monolo Feb 20 '12 at 11:40
@Monolo: JRuby+Truffle can (experimentally) use a C interpreter called TruffleC to interpret Ruby C extensions at runtime, instead of linking against natively compiled libraries. This, interestingly, results in better performance than using compiled C extensions from YARV (the "standard" Ruby implementation). Let me repeat that: using interpreted C extensions from JRuby is faster than using compiled C extensions from YARV: – Jörg W Mittag Aug 28 '15 at 12:35

protected by GlenH7 Oct 3 '14 at 10:56

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).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.