3 ms·
I suppose I almost solely use Cython for numerics, which seems to be reliable. Anything that's not numerics is not usually the bottleneck for my code and so is
by doubleunplussed 9y ago
I suppose I almost solely use Cython for numerics, which seems to be reliable. Anything that's not numerics is not usually the bottleneck for my code and so is left as Python. So I can't comment on problems trying to use the C end of the Cython continuum as a general purpose replacement for C.
For my numerics at least I can't say I've had to dig through generated C. I generate the annotated html to ensure that what I thought would translate to pure C without python API calls indeed has, but I've never had to actually read the C it generates.
- dom0 9y agoThe annotated mode is indeed very nice to browse the generated C code, although I still needed to manually read the .c in some cases. The annotated code elides things like the (many thousand lines of) Cython support code; but since few things are documented I sometimes even needed to dig through those, deciphering nested #ifs and whatnot just to see whether the code would be correct. E.g. what does `cdef char *something = somethingelse` give me. Even if you know the type of somethingelse it's at best a guess. (Bonus question: Say you know somethingelse is going to be a Python bytes object. Does something point to a copy?)