Back when I used Cython more, I did always use Cython and just gradually type 
in things as required (or for some things do the equivalent of #include some C 
for some SSE intrinsics type codes). I agree it is not generally "popular", but 
it is a very legitimate mode of usage. Adding more and more cdef's etc. brings 
your code closer and closer to C semantically while staying in Cython syntax. 
Partly, I had better profiling tools for such code than "pure python" style.

They even have a nice \--annotate mode supporting this usage style that spits 
out an HTML page with clickable generated code colorized by how C-like it is. 
That kind of source to "assembly" visualization tool would be nice for Nim as 
well, or even just gcc/clang going all the way to "real" assembly. It's got a 
bit more "oomph" for things spanning orders of magnitude of efficiency like 
pure Py and C, though, and the CPython API calls Cython generates may be (a 
little easier to read than real assembly, much like the C code Nim generates.

Now, why good modes of usage (of almost anything) are not more popular..well, 
that's some question for the ages. People are imitative. "It's not popular 
because it's not popular." How to bootstrap something catching on is 
just..tricky.

Reply via email to