-
Notifications
You must be signed in to change notification settings - Fork 10
Description
PythoC currently generates LLVM IR, which is great!
But to make it more portable and available on more exotic target platforms, one could also consider emitting C/C++ instead of LLVM IR. This would make the emitted code more readable, possible to inspect and change if needed and more importantly, possible to compile with a target C/C++ compiler on systems where LLVM toolchains may be unavailable (yet). BTW, IIRC Nim actually generates C/C++ instead of e.g. LLVM IR directly. So, there is definitely a prior art related to this idea.
Is it something technically doable?
Does PythoC use any LLVM IR or LLVM features that cannot be represented in C/C++ form?
Is current IR easy and rich enough to be used as a basis for generating C/C++ or it needs to be extended quite a bit to make it possible?
It would be really interesting to hear your thoughts about this idea.