Hi Eike,
Two important questions there. I think the argument for using ctypes rather than swig is that ctypes is automatic and robust. Swig seems to involve more manual intervention and complexity.
The code generation happens in two places. The user kernel is either already a C string or (more usually) is a Coffee AST. The Coffee AST has the built-in ability to generate the C code for that part. However I suspect you are more interested in where the code generation for the wrapper code happens. This happens in host.JITModule.compile . It uses a wrapper template from sequential.JITModule (sequential.JITModule is a subclass of host.JITModule).
Is that what you were after?
Cheers,
David