Skip to content

JIT Code Generation with AsmJit and AsmTk

Photo of Richard Thomson
Hosted By
Richard T.
JIT Code Generation with AsmJit and AsmTk

Details

What do you do if you have some sort of user-defined expressions that you need to evaluate? Let's assume you have some way of parsing that text into a meaningful data structure, such as an abstract syntax tree (AST). The obvious answer is to write some code that traverses your AST and acts as an interpreter to produce the results.

Iterated Dynamics has a "formula" fractal type that allows you to write your own little formula for iterating points in the complex plane in order to define your typical "escape time" fractal. Currently, the code uses an interpreter approach as described above.

However, this interpreted formula is in the inner loop of the image computation. The original MS-DOS FRACTINT code had a just-in-time (JIT) code generator for the 8087/80287/80387 math coprocessor that would compute the formula described by the user's input. Because this code was executing natively on the hardware, it outperformed any interpreter.

This month, Richard Thomson will give us an overview of the AsmJit/AsmTk libraries for generating in-memory machine instructions that we can call from C++. We'll look at how AsmJit exposes the assembly and linking process and the tools that it provides beyond the basic process of storing machine code into memory.

AsmJit/AsmTk: https://asmjit.com/

This will be an online meeting, so drinks and snacks are on you!

Join the meeting here: https://meet.xmission.com/Utah-Cpp-Programmers

Watch previous topics on the Utah C++ Programmers YouTube channel:
https://www.youtube.com/@UtahCppProgrammers

Future topics: https://utahcpp.wordpress.com/future-meeting-topics/
Past topics: https://utahcpp.wordpress.com/past-meeting-topics/

Photo of Utah C++ Programmers group
Utah C++ Programmers
See more events

Every 2nd Wednesday of the month until December 11, 2035

Online event
Link visible for attendees
FREE