Boost :: Python, as in wheat's answer, is a very mature solution.
Lua's reputation is easy to build in, but I haven't tried it myself.
As a user of R , I'm more interested in embedding R , which is possible with the RInside package. A simple example:
#include <RInside.h> // for the embedded R via RInside int main(int argc, char *argv[]) { RInside R(argc, argv); // create an embedded R instance R["txt"] = "Hello, world!\n"; // assign a char* (string) to 'txt' R.parseEvalQ("cat(txt)"); // eval the init string, ignoring any returns exit(0); }
and there are a few more examples in the package. RInside essentially provides you with a good wrapper around the R mechanism using some of Rcpp .
source share