python to C code generator

Chris Angelico rosuav at gmail.com
Tue Jan 23 10:14:48 EST 2018


On Wed, Jan 24, 2018 at 1:45 AM,  <theodore.leblanc at financecentre.club> wrote:
> Hey Ally,
>
> Cython adds a big chunk of complexity to simple things. That's the problem.

That's like saying "Unicode adds a big chunk of complexity to the
simple task of translating a word from Japanese into Russian". No, it
doesn't; the complexity is inherent in the problem. You cannot
translate Python code into C code without either (a) reimplementing
all of Python's semantics, as Cython does; or (b) drastically changing
the semantics, such that even the very simplest of code might behave
quite differently; or (c) manually reading through the code and
writing equivalent C, which is what you might call "porting" or
"rewriting". (Or possibly "prototyping", if the intention was always
to transform it into C.) There is fundamentally NO easy way to
translate code from one language into another and get readable,
idiomatic code at the other end.

ChrisA



More information about the Python-list mailing list