Interpreter for C/C++?

Discussion in 'C++' started by ssecorp, Jul 6, 2008.

  1. ssecorp

    ssecorp Guest

    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++?
    ssecorp, Jul 6, 2008
    #1
    1. Advertising

  2. ssecorp wrote:
    > 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.
    Juha Nieminen, Jul 6, 2008
    #2
    1. Advertising

  3. Markus Elfring, Jul 6, 2008
    #3
  4. ssecorp

    drhilbert Guest

    On Jul 6, 5:27 pm, Markus Elfring <> wrote:
    > > Why is there no interpreter for C/C++?

    >
    > Would you like to try a tool like "Ch" or "CINT"?http://en.wikipedia.org/wiki/Ch_interpreter
    >
    > Are you looking for more free software alternatives?
    >
    > Regards,
    > Markus


    I'm using CINT (embedded into ROOT http://root.cern.ch) since a long
    ago and I like it quite a lot!

    Cheers,
    hilbert
    drhilbert, Jul 6, 2008
    #4
  5. ssecorp wrote:
    > 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?

    --
    Gennaro Prota | <https://sourceforge.net/projects/breeze/>
    Do you need expertise in C++? I'm available.
    Gennaro Prota, Jul 6, 2008
    #5
  6. ssecorp

    Greg Herlihy Guest

    On Jul 6, 6:53 am, ssecorp <> wrote:
    > 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
    Greg Herlihy, Jul 6, 2008
    #6
  7. Simon Connah a écrit :
    > On 2008-07-06 14:53:58 +0100, 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++?

    >
    > There is an interpreter for C floating around somewhere. I have
    > forgotten what it is called though.
    >
    > I have no idea about C++ though, my guess would be not.


    Here is one I know of:

    http://code.google.com/p/cpsh/

    Blog entry
    http://blog.davber.com/2007/01/29/scripting-in-python-ruby-perl-no-in-c/
    Michael DOUBEZ, Jul 7, 2008
    #7
  8. Hello,

    ssecorp wrote:

    > 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
    Bernd Strieder, Jul 7, 2008
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Goblin
    Replies:
    1
    Views:
    8,449
  2. adam
    Replies:
    0
    Views:
    959
  3. MackS
    Replies:
    0
    Views:
    466
    MackS
    Mar 11, 2005
  4. Michael Pitoniak
    Replies:
    1
    Views:
    554
    Michael Pitoniak
    Dec 20, 2003
  5. Replies:
    3
    Views:
    758
    Ziga Seilnacht
    Jan 3, 2007
Loading...

Share This Page