Abdulaziz Asiri
Abdulaziz Asiri

Reputation: 93

How can a compiling language be interpreting language

I have a question. I actually know the difference between compiling and interpreting languages. But, What I do not really understand is , how can any programming language be both compiling and interpreting ? Thank you.

Upvotes: 1

Views: 75

Answers (2)

rici
rici

Reputation: 241931

One possible way to "interpret" a program fragment is to compile it and then invoke the compiled code. Using this procedure would allow you to implement any behavioural aspect of an interpreter, such as a REPL, or the eval function itself.

Upvotes: 2

sepp2k
sepp2k

Reputation: 370435

If an interpreting language is one for which an interpreter exists and a compiling language is one for which a compiler exists, then a language can be both if someone wrote an interpreter for it and someone else (or the same person/team) wrote a compiler for it.

Upvotes: 2

Related Questions