In the C++ tag wiki, it is stated that
C++ is a ... (usually) compiled ... programming language ...
Yet Wikipedia and cplusplus.com assert that C++ is a compiled language without mentioning any exceptions.
Could you please tell us the reason why C++ is usually, yet not always, a compiled language? When can C++ be deemed a non-compiled language?
Wikipedia:
C++ is a compiled language, with implementations of it available on many platforms.
cplusplus.com:
... is a compiled language. C++ compiles directly to a machine's native code, allowing
This may suggest that there are non-compiled forms of C++. What makes the wiki to state 'usually'?
C is a compiled programming language. This means that it uses a compiler to analyse the source code written in C and then turns it into a binary file that the computer's hardware can directly execute. This will be specific for each particular machine.
C is what is called a compiled language. This means that once you write your C program, you must run it through a C compiler to turn your program into an executable that the computer can run (execute).
A compiled language is a programming language that is generally compiled and not interpreted. It is one where the program, once compiled, is expressed in the instructions of the target machine; this machine code is undecipherable by humans. Types of compiled language – C, C++, C#, CLEO, COBOL, etc.
A compiled language is a programming language whose implementations are typically compilers (translators that generate machine code from source code), and not interpreters (step-by-step executors of source code, where no pre-runtime translation takes place).
Because "C++" as defined by the C++ Standard is only a programming language, operating in an abstract machine. Implementations are free to do whatever they want to emulate the behaviour of that abstract machine.
Therefore, regardless of whether someone actually makes a C++ interpreter, saying that C++ is always compiled would be an unfounded assumption.
There is no technical reason why you can't write a C++ interpreter rather than a compiler and I believe some have been written in the past.
C is also a (usually) compiled language, but I myself wrote a (slow, recursive decent) C89 interpreter some 20 years ago. C++ is just a (much) harder version of the same problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With