How does CINT work?

View: New views
3 Messages — Rating Filter:   Alert me  

How does CINT work?

by yangzhang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, is there any document or resource describing how CINT works from a
high level? I (and I'm sure others) are wondering out of curiosity.
Any details you can spare would be great.

The only other C REPL I've come across is
http://neugierig.org/software/c-repl/, and that works by incrementally
compiling the expression as a function in a dynamic library, then
dynamically linking to that library and calling the function. However,
I'm not sure how it handles variable declarations and references -
perhaps it accumulates all prior lines and recompiles everything.

Thanks in advance!
--
Yang Zhang
http://www.mit.edu/~y_z/


Re: How does CINT work?

by Philippe Canal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

You can find documentation for CINT at
http://root.cern.ch/drupal/content/cint
and some related documentation on CINT in ROOT at
ftp://root.cern.ch/root/doc/7CINT.pdf

CINT is capable of 'interpreting' most of C++.   In addition, it can
seemlessly interact with
compiled C++ by generating dictionary which gives you both the ability
to call the C++
and to inspect the set of classes and their content (i.e. introspection
and reflection).

CINT works by interpreting/executing each instructions and keeping
tracks of the 'state'
(i.e. list of global variable, stack of scope and their list of
variables, etc.).

To code the docs: "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."

In which context are you interested in a C++ interpreter?

Cheers,
Philippe.

Yang Zhang wrote:

> Hi, is there any document or resource describing how CINT works from a
> high level? I (and I'm sure others) are wondering out of curiosity.
> Any details you can spare would be great.
>
> The only other C REPL I've come across is
> http://neugierig.org/software/c-repl/, and that works by incrementally
> compiling the expression as a function in a dynamic library, then
> dynamically linking to that library and calling the function. However,
> I'm not sure how it handles variable declarations and references -
> perhaps it accumulates all prior lines and recompiles everything.
>
> Thanks in advance!
>  


Re: How does CINT work?

by Dr. Prasad, B.V.L.S. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



 "CINT makes C/C++ programming enjoyable .."

Wonderfully expressed by Philippe. The sentence very close to me is the above one:
Thanks for continuously maintaining and improving CINT. Kudos.

Thanks
Prasad.