is there a good example how to compile(execute) c code with libclang on the fly?

Date: Sun, 9 Oct 2016 19:13:37 +0200
From: Dennis Luehring via cfe-dev <cfe-dev@lists.llvm.org>
To: Clang Dev <cfe-dev@lists.llvm.org>
Subject: [cfe-dev] is there a good example how to compile(execute) c
        code with libclang on the fly?
Message-ID: <efbadb7e-f142-a1f8-cc18-0aced61202a6@gmx.net>
Content-Type: text/plain; charset=iso-8859-15; format=flowed

i want to compile simple c functions from strings with libclang and execute
them on the fly inside my application

its is for an simple function evaluator experiment with c as a scripting
language

any ideas/links?

Possiblities...

Handmade Hero Day 021 - Loading Game Code Dynamically
https://m.youtube.com/watch?v=WMSBRk5WG58

Handmade Hero Day 022 - Instantaneous Live Code Editing
https://m.youtube.com/watch?v=oijEnriqqcs

Handmade Hero Day 023 - Looped Live Code Editing
https://m.youtube.com/watch?v=xrUSrVvB21c

http://fdiv.net/2012/08/15/compiling-code-clang-api
https://root.cern.ch/cling

https://github.com/RuntimeCompiledCPlusPlus/RuntimeCompiledCPlusPlus
https://github.com/RuntimeCompiledCPlusPlus/RuntimeCompiledCPlusPlus/wiki/Alternatives

cheers -ben

i've already found the other blogs/projects before

the idea was to not generate an executeable on disk but run it directly from memory - could that be possible (linux, windows?)

i've already found the other blogs/projects before

the idea was to not generate an executeable on disk but run it directly
from memory - could that be possible (linux, windows?)

Cling does exactly that:

Jon