Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to execute C++ code without compiling it?

In order to pass some code to an application created with C++ I have used a C++ open source code which acted as a TCL interpreter. So I could create a file, in there put some XML data and in some tags some TCL code. Finally it is possible to read the file configure some structure and execute the TCL script snippets from the XML file in appropriate places. In order to not use C++ and TCL simultaneously I ask the following:

Is there an open-source C++ code that can execute a C++ code without compiling? In other words is there a C++ interpreter.

like image 822
Narek Avatar asked Jul 27 '10 20:07

Narek


People also ask

Can you run C without compiling?

If you only have a ". c" file, then you don't have a program. You must compile the program first to make an executable, and then you must run the program to get its output.

Can program execute without main method?

Yes, we can execute a java program without a main method by using a static block. Static block in Java is a group of statements that gets executed only once when the class is loaded into the memory by Java ClassLoader, It is also known as a static initialization block.


1 Answers

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.

like image 116
SigTerm Avatar answered Oct 04 '22 02:10

SigTerm