JLBorges,
> The expression isn't known until runtime.
> The expression will be evaluated enough times to amortize the cost of compilation.
> Latency and throughput demands require low cost for compilation.
Yes, that sounds very much like what I was looking for. I will try this out this weekend (time allowing).
helios,
> The C++ implementation is provided by Clang, acting as a JIT compiler. The
> performance of the generated code is identical to that of code generated by the
> command line compiler.
Thanks, I'll explore your code too, which could be equally useful.
That also sounds promising. I will test it out when I have time.
keskiverto,
I've made an expression parser using trees and the shunting yard algorithm, but I could never get it to be as fast as compiled code. I admit I have not used a library someone else has made for run-time expression parsing, so I should do more benchmarks. I could also never get a scripting language (Python) to be close in speed to C++ when dealing with per-pixel operations with math equations. Given this, I was really curious as to whether there were compilation-based solutions instead of interpretation, even if just for the sake of curiosity (but I am more confident than not that it would have real speed benefits, as well).
But yes, perhaps I should try out something like
https://github.com/cparse/cparse and do some benchmarks with it, to see exactly what speed I'm losing or gaining compared to compilation.
dhayden,
With all respect, I never implied that. Sorry if it seems that way. But of course, what you said is correct.
Thanks all. Probably won't be able to actually test out code for a few days but I appreciate the fast replies.