Timeline for Use Cython as Python to C Converter
Current License: CC BY-SA 3.0
21 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 13, 2016 at 21:33 | comment | added | gvoysey | @agf i honestly have no idea. What i have to do is really simple data munging, though, so i hope I can work within rpython and emit "clean" C. | |
| Jun 12, 2016 at 21:16 | comment | added | agf | @gvoysey You can't Cython to translate to C and then link it to libpython? Seems unlikely vworks wouldn't have a linker? | |
| Jun 12, 2016 at 16:19 | comment | added | gvoysey | @agf it's vworks. C is kind of the only supported game in town. If RPython/ PyPy spits out something that gcc can compile, great. If not, i guess I get my hands dirty. | |
| Jun 11, 2016 at 4:10 | comment | added | agf | @gvoysey Possibly, I don't know. Keep in mind it only works for RPython, not true Python. But if your goal is to run the code on an embedded system, I don't think translating to C should be your goal. Depending on what you mean by "embedded" you may be able to use a regular Python interpreter, or Cython + libpython. If you mean a microcontroller, you may want to look into MicroPython. | |
| Jun 11, 2016 at 2:07 | comment | added | gvoysey |
@agf sorry to bump a very old question: would c code generated as you describe in your answer be portable enough to run on an embedded system that would have zero python-related things installed on it --some IoT system, for example. I know this isn't true for Cython (which depends on libpython)
|
|
| S Mar 2, 2016 at 10:09 | history | suggested | user554319 | CC BY-SA 3.0 |
update broken link
|
| Mar 2, 2016 at 9:45 | review | Suggested edits | |||
| S Mar 2, 2016 at 10:09 | |||||
| Sep 30, 2013 at 0:58 | comment | added | agf | @alcalde I've cleaned up this (very old) answer somewhat; you're right, it was misleading. | |
| Sep 30, 2013 at 0:54 | history | edited | agf | CC BY-SA 3.0 |
added 1 characters in body
|
| Sep 29, 2013 at 19:17 | comment | added | alcalde | You don't use PyPy to translate Python to C. You use Cython, which was designed for this task. The user does not want to translate RPython to C, which would be a convoluted approach anyway while Cython offers a simple, clear path. | |
| S Feb 14, 2013 at 15:31 | history | suggested | Community Bot | CC BY-SA 3.0 |
updated path to PyPy translation toolchain and Rpython
|
| Feb 14, 2013 at 15:30 | review | Suggested edits | |||
| S Feb 14, 2013 at 15:31 | |||||
| Mar 21, 2012 at 6:09 | comment | added | agf | @KyssTao R Python is what PyPy can translate to C. Read the next section of that FAQ, my answer, and the other links. | |
| Mar 21, 2012 at 5:58 | comment | added | Kyss Tao | @agf I saw this link before, I tried it out now: I only get a binary, no C source, and it does not work for my example above. Also what do you think they mean by 'PyPy cannot compile normal Python programs to C' at doc.pypy.org/en/latest/… ? That does not sound good :-( | |
| Mar 21, 2012 at 3:32 | comment | added | Kyss Tao |
@agf, I cannot figure out how to translate a python program (say hello.py containing one line i=1; print hello, 1) to a c source file that I can look at in an editor and compile with gcc. I'd appreciate if you could help me with an example.
|
|
| Aug 19, 2011 at 2:04 | vote | accept | Community Bot | ||
| Aug 19, 2011 at 0:36 | history | edited | agf | CC BY-SA 3.0 |
added 355 characters in body
|
| Aug 18, 2011 at 19:40 | history | edited | agf | CC BY-SA 3.0 |
added 14 characters in body
|
| Aug 18, 2011 at 19:30 | comment | added | agf | Read the answer more closely. PyPy is two things, an implementation of Python, and a Python translator / compiler. You don't want the first, you want the second. The translation toolchain I linked to has details on what you want. | |
| Aug 18, 2011 at 19:26 | comment | added | user845459 | So It's a translator that gives you .c ? I thought is specific implementation of python for making it fast.Being fast is not my concern. | |
| Aug 18, 2011 at 19:20 | history | answered | agf | CC BY-SA 3.0 |