Answers in C, Python, C++ or Javascript would be very much appreciated. I\'ve read a few books, done all the examples. Now I\'d like to write a simple program. But, I already ra
In compiled languages like C, C++, or Java there is no easy way to do this--you basically have to rewrite a whole compiler (or use an external library with an interpreter). This is only trivial in "scripting" languages like Python and Javascript, which have a function (often called "eval()") that evaluates expressions at runtime. This function is often dangerous, because it can also do things like call functions with side effects.