Why interpret at all? Back in the mid to early 90's I started embedding C++ compilers into the game engines I wrote, where the "game scripting language" was just #define macros hiding the C++ syntax so the game level developers, who worked in this script, could be basically anyone that could code. Their "script" would compile to a DLL that was hot loaded. What they were doing in their scripts would compile in under 5 seconds, and they were good to go. If they ran into problems, one of the game engine developers would just run their "script" in the IDE debugger.<p>Borrowed this idea from Nothing Real, the developers of Shake, the video/film compositing system.
Folks who like this kind of thing should definitely check out CERN's Root framework. I've been using its C++ interpreter in a Jupyter notebook environment to learn C++. It's probably also quite a bit more mature than this project. <a href="https://root.cern/" rel="nofollow">https://root.cern/</a>
Along the lines of scripting is interactive programming. I'm working on a native Clojure dialect on LLVM with C++ interop, qalled jank. It can JIT compile C++ code, can be embedded into any C++-compatible application, and is a full Clojure dialect which doesn't hid any of its C++ runtinme. So you can do inline C++, compile C++ sources alongside your jank. and require them like a normal Clojure namespace. Worth a look if you're using C++ but you're craving something more interactive. <a href="https://jank-lang.org/" rel="nofollow">https://jank-lang.org/</a>
I wonder if I can use this to learn a large c++ codebase like Chromium. One of the issues I had trying to learn chromium was that in order to play and experiment with their classes/functions I needed to spend several minutes to link my little test code with their static libraries just to be able to see if my understanding of them was correct. Which is just too long of time for such experiments so I gave up.
How feasible would it be for something like gdb to be able to use a C++ interpreter (whether icpp, or even a souped up `constexpr` interpreter from the compiler) to help with "optimized out" functions?<p>gdb also doesn't handle overloaded functions well, e.g. `x[i]`.
This is really cool...<p><a href="https://github.com/vpand/icpp-qt">https://github.com/vpand/icpp-qt</a><p>Ok <i>now</i> things are getting interesting. I think this could be used to add easily shareable/hackable plugins to existing C++ projects.
Related is cargo script for Rust: <a href="https://doc.rust-lang.org/cargo/reference/unstable.html#script" rel="nofollow">https://doc.rust-lang.org/cargo/reference/unstable.html#scri...</a> (nightly only)