Tiny C Compiler
bellard.org
bellard.org
Result is amazing speed for emulation!
libtcc is /massively/ clever, it will 'link back' to your (exported) ELF symbols automatically. Basically it links the piece of code to your current running process, with all it's libs etc.
So if you have a function blob(int); in your main program, just call it from the C you generate, and it'll Just Works.
For my own purpose, I decided to trim down the headers I would have to include in the generated C and made some sort of simpler 'trampoline', but it's not strictly necessary.
There has been some continued development of tcc; the GitHub repository here has changes through April 2016: https://github.com/TinyCC/tinycc
https://en.m.wikipedia.org/wiki/LCC_(compiler)
Note: It's not FOSS but is free for personal use. Should be fine if used for DDC.
edit: If you want to get an idea about what happens in TCC-land, you should check out the mailing list archives [1], eg a recent-ish status update [2].
[1] http://lists.nongnu.org/archive/html/tinycc-devel/
[2] http://lists.nongnu.org/archive/html/tinycc-devel/2016-11/ms...
http://www.qemu-advent-calendar.org/2016/#day-16Also a quick look at the upstream tinycc-devel list tells me that, a patched 2.4.26 Kernel (32 bit) was still the latest compatible version with TCC -- https://lists.nongnu.org/archive/html/tinycc-devel/2015-11/m...
Merry Christmas/Happy Holidays my HN-friend! Have a great end of 2016 and a happy and healthy start to 2017 :)
TCC is an amazing project, and very useful, as there are few multiplatorm "C99 enough" compliant compilers. Also, it is suitable for using C as scripting language (!)
P.S. Fabrice Bellard is a genius.
I've also used it to get something like closures for C.
@buserror's project sounds like a better example with code.