Fork me on GitHub
#off-topic
<
2017-06-06
>
adamvh22:06:26

so one use-case in which it is pretty groovy to have access to a "compile" function at run-time is for something like a differential equation solver

adamvh22:06:00

where you might want to allow your user to solve differential equations with arbitrary right-hand sides

adamvh22:06:26

but you'd like to parse the user input and compile it into machine-code because it's evaluated many times in the inner-loop of your solver

adamvh22:06:07

in c++ it's basically impossible for us to get this behavior - the user input becomes like some AST objects that we walk and evaluate at run-time, so we have to tell our users "yeah, we provide this way for you to enter arbitrary functions, but you shouldn't really use it for performance reasons"