Skip to content

Santa Clara: Dynamic Code Generation with LLVM

Photo of Richard Powell
Hosted By
Richard P. and 2 others
Santa Clara: Dynamic Code Generation with LLVM

Details

Does generating machine code on the fly, never mind executing it, sound intimidating? It has never been easier! In this talk, we'll explore a simple calculator program that accepts an expression as input, translates it to machine code, executes it, and prints the computed result. To make it more interesting, this calculator supports simple variables and one parameter functions, as well as branching via the ? : operator.

LLVM is a language-independent compiler framework that does powerful optimizations and machine code generation. When you compile C++ with clang (or any other language with clang), you're using LLVM behind the scenes. Though industrial strength enough to handle whatever a C++ compiler throws at it, it's surprisingly easy to use. We'll also explore how flex and bison are used to tokenize and parse expressions.

About the Speaker:

Our speaker, Jeff Cohen, is a certified language nerd. He has been using C++ since cfront was a thing.

Photo of Cpp Bay Area: C++ Programming In and Around Silicon Valley group
Cpp Bay Area: C++ Programming In and Around Silicon Valley
See more events