If you would like, that a variable should accept each data type, also code, maybe, that you would like can be executed (and also compiled before), then you should take a dynamic programming language, which you can also combine with C/C++.
I would take "squirrel", because it has a C/C++ like syntax.
Some informations about squirrel and download here:
http://www.squirrel-lang.org/
If you would be interersted, I also could offer a C/C++ squirrel interface