views:

1016

answers:

6

I am curious if anyone have used UnderC, Cint, and Ch (or any other C++ interpreter) and could share their experience.

Thanks everyone for your valuable input.

/Allan

+2  A: 

Long ago, I used a C++ interpreter called CodeCenter. It was pretty nice, although it couldn't handle things like bitfields or fancy pointer mangling. The two cool things about it were that you could watch when variables changed, and that you could evaluate C/C++ code on the fly while debugging. These days, I think a debugger like GDB is basically just as good.

jfm3
What would the interpreter do when it encountered a template instance? (or other preprocessing business). Was there some level of precompilation/preprocessing to handle templates or the preprocessor?
Doug T.
Yes, all the CPP stuff and templates were all part of the language being interpreted. Pretty nice.
jfm3
+1  A: 

Also long ago I used a product call Instant C but I don't know that it ever developed further

+3  A: 

I have (about a year ago) played around with Ch and found it to be pretty good.

Alan
+5  A: 

cint is the command processor for the particle physics analysis package ROOT. I use it regularly, and it works very well for me.

It is fairly complete and gets on well with compiled code (you can load compiled modules for use in the interpreter...)

late edit:: Copied from a later duplicate because the poster on that questions didn't seem to want to post here: igcc. Never tried it personally, but the web page looks promising.

dmckee
I know several graduate students in physics that do the majority of their coding in cint/root, and while they don't always have nice things to say it meets their needs for performance and flexibility.
Well, it is c++ with an add layer of complexity from needing to build the interperter<-->binary-code dictionaries. Plus the root class tree is a pain. But cint works. It works a lot better than COMIS did in the cernlib days.
dmckee
A: 

I looked at using ch a while back to see if I could use it for black box testing DLLs for which I am responsible. Unfortunately, I couldn't quite figure out how to get it to load and execute functions from DLLs. Then again, I wasn't that motivated and there may well be a way.

Jon Trauntvein
A: 

There is a program called c-repl which works by repeatedly compiling your code into shared libraries using GCC, then loading the resulting objects. It seems to be evolving rapidly, considering the version in Ubuntu's repository is written in Ruby (not counting GCC of course), while the latest git is in Haskell. :)

Matthew Flaschen