Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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

share|improve this question
4  
I always thought it was a compiled language. I'm curious where the confusion comes from... –  FrustratedWithFormsDesigner Jul 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.Lott Jul 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. –  delnan Jul 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 Starynkevitch Oct 3 at 7:26

1 Answer 1

up vote 24 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
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. 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
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. –  Monolo Feb 20 '12 at 11:40

protected by GlenH7 Oct 3 at 10:56

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

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.