Bitey: Import LLVM bitcode directly into Python
github.com
github.com
I wonder how complicated it would be to parse header files to populate field names of structs automatically? Maintaining separate .pre.py and .h files seems like recipe for trouble.
To parse headers for field names would require a complete C preprocessing and parser. That wouldn't be a problem for this author (who wrote a very popular parser generator for Python), but it still wouldn't be perfect until it completely replicated the system compiler's behaviour with respect to system headers (consider conditional compilation). It is particularly annoying if the host and target systems are different, i.e. in cross compilation. I've tried this exact thing (header parsing to get type information) and it is quite a pain to get it right.
Also, templates.
Also, a bunch of other things.
http://llvm.org/docs/FAQ.html#can-i-compile-c-or-c-code-to-p...
swig requires glue code (.i files) to be written and generated, then compiled. ctypes can take a system native library (.so or .dll) and access it.
bitey, on the other hand, uses platform-neutral llvm bytecode. imagine ctypes but platform neutral. that's bitey.
pretty darned cool.
(AFAIK, please correct me if I'm wrong)
Not an LLVM expert though, I could be glossing over a few details.