I have written a complex math library for JavaScript that features the ability to generate functions from strings of human-readable math expressions. Is there a way to achieve an equivalent of runtime-generated functions in C++?
FUZxxl's answer is right, and I recommend looking at the Clang/LLVM facility.
There is a basic (not so helpful) tutorial file here. And a broad tutorial on writing your Language on LLVM. You can load your generated library in your C++ App.
Unless, you have a performance critical component, you can employ the use of ChaiScript (NB: I am in no way affiliated to it or the authors)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With