JIT calculators finale

17 points by wofo


spc476

I actually forgot I did a simple JIT about ten years ago in order to benchmark overflow testing on x86. I used DynASM (used by LuaJIT) and found it rather easy to use, despite the documentation at the time. The expression parser wasn’t anything fancy, no precedence or anything like that. If I were to do precedence, I’d use the Shunting Yard Algorithm which makes it very easy to add new operators.

andrus

The author’s first post in this series also links to How to JIT (previously shared here), which is a tidy write-up on how to create and execute machine code from C. It’s very similar to the author’s setup code in Rust.

wofo

In case anyone is interested, the previous article in the series received some insightful comments on lobste.rs (about approaches to JIT)