How to execute C++ code without compiling it?
CINT
- Archived CINT old official page from web.archive.org
- Original inventor "Masaharu Goto" CINT page (CINT : C++ interpreter)
What is CINT?
CINT is an interpreter for C and C++ code. It is useful e.g. for situations where rapid development is more important than execution time. Using an interpreter the compile and link cycle is dramatically reduced facilitating rapid development. CINT makes C/C++ programming enjoyable even for part-time programmers.
CINT is written in C++ itself, with slightly less than 400,000 lines of code. It is used in production by several companies in the banking, integrated devices, and even gaming environment, and of course by ROOT, making it the default interpreter for a large number of high energy physicists all over the world.
I must admit I didn't expect there to be one, but a search has revealed the following:
Ch
However:
Ch (pronounced /ˌsiːˈeɪtʃ/) is a cross-platform C and C++ interpreter. It is provided by SoftIntegration, Inc for C/C++ users. Ch is useful for scripting, shell programming, 2D/3D plotting, numerical computing, and can be embedded in other applications to add scripting capability. Ch can be used for both server-side and client-side web development. It runs under Windows, Linux, Mac OS X and some versions of Unix. Ch supports C90 and major C99 features, but it doesn't support full C++ features.
Source
So check it covers the features you need.
Yes. Check this out: http://root.cern.ch/drupal/content/cint (it is free software, too).
Apart from that: you can certainly find a better solution than embedding a C++ interpreter, especially with far more light-weight, easily embedabble languages like Lua, Python, etc.