"use cython as python to c converter" Code Answer

  1. yes, at its core this is what cython does. but ...
  2. you don't need cython, however, you do need libpython. you may feel like it doesn't use that many python features, but i think if you try this you'll find it's not true -- you won't be able to separate your program from its dependence on libpython while still using the python language.

another option is pypy, specifically it's translation toolchain, not the pypy python interpreter. it lets you translate rpython, a subset of the python language, into c. if you really aren't using many python language features or libraries, this may work.

pypy is mostly known as an alternative python implementation, but it is also a set of tools for compiling dynamic languages into various forms. this is what allows the pypy implementation of python, written in (r)python, to be compiled to machine code.

if c++ is available, nuitka is a python to c++ compiler that works for regular python, not just rpython (which is what shedskin and pypy use).

By Codeversed on October 1 2022

Answers related to “use cython as python to c converter”

Only authorized users can answer the Search term. Please sign in first, or register a free account.