Interpreter for C/C++?

S

ssecorp

Why is there no interpreter for C/C++?

Compiled code is faster but interpreted code is easier to debug and
test.

Wouldn't an interpreter speed up development in c/C++?
 
J

Juha Nieminen

ssecorp said:
Why is there no interpreter for C/C++?

C might be easier to interpret because it's rather straightforward.
The interpreter, though, would have to safely emulate the memory
allocation routines of the C library so that the program being
interpreted cannot corrupt the interpreter itself nor its data.

C++ is a bit tougher. Instantiation of template functions and classes,
for instance, may require an almost full-fledged compiler which compiles
at least to some intermediate templateless code based on the type of
instantiations, and probably cannot be simply "interpreted" in a
line-by-line basis.
Wouldn't an interpreter speed up development in c/C++?

Perhaps. OTOH debugging compilers and profilers seem to do a pretty
good job even with compiled code which has debug info in it.
 
G

Gennaro Prota

ssecorp said:
Why is there no interpreter for C/C++?

Compiled code is faster but interpreted code is easier to debug and
test.

Wouldn't an interpreter speed up development in c/C++?

"Easier" to debug and test? Care to explain?
 
G

Greg Herlihy

Why is there no interpreter for C/C++?

Compiled code is faster but interpreted code is easier to debug and
test.

Wouldn't an interpreter speed up development in c/C++?

A company called Saber Software sold a C++ interpreter way back in
1991. Here's a short description from Software Magazine:

http://findarticles.com/p/articles/mi_m0SMG/is_n8_v11/ai_10990784

It seems likely that the interpreter's $4,000 (per copy) price tag,
necessarily limited the size of its market.

Greg
 
B

Bernd Strieder

Hello,
Why is there no interpreter for C/C++?

Compiled code is faster but interpreted code is easier to debug and
test.

Wouldn't an interpreter speed up development in c/C++?

While not strictly an interpreter, there is valgrind to execute some
program at the machine language level step by step with the possibility
to instrument in various ways. It has been available under Linux for
years don't know about other platforms.

Bernd Strieder
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top