Skip to content

Initial Cython patch for Pyston.#528

Merged
scoder merged 1 commit intocython:masterfrom
Daetalus:pyston_changes
Aug 16, 2016
Merged

Initial Cython patch for Pyston.#528
scoder merged 1 commit intocython:masterfrom
Daetalus:pyston_changes

Conversation

@Daetalus
Copy link
Copy Markdown
Contributor

@Daetalus Daetalus commented Jul 13, 2016

Hi All,

The changes in this PR originally from try to run extensions which needs Cython(NumPY, SciPy, lxml) in Pyston.

During the process of try to support more extensions in Pyston. There may have more Pyston changes in Cython.

Thoughts?

@Daetalus Daetalus force-pushed the pyston_changes branch 5 times, most recently from c7cb599 to 08bed00 Compare July 14, 2016 04:17
@scoder
Copy link
Copy Markdown
Contributor

scoder commented Jul 18, 2016

Thanks. However, rather than making the CPYTHON macro ambiguous, I'd like to see a change of its usages to distinguish PYPY from the others. PyPy is currently the only other "supported" backend apart from CPython, so the current macro usages were just a guess and are subject to change.

Also, we do not define our own officlal looking C-API functions in Cython. Instead, we use our own internal functions prefixed with __Pyx_. So adding __Pyx_PyFrame_SetLineNumber() and __Pyx_PyCode_HasFreeVars() would be ok. Preferably as macros, as "inline" isn't C89 compatible.

@Daetalus
Copy link
Copy Markdown
Contributor Author

Thanks for your feed back. But would you mind to clarify your first paragraph please?

@scoder
Copy link
Copy Markdown
Contributor

scoder commented Jul 21, 2016

Sure. Sorry for not being clear. What I meant was that many usages of "COMPILING_IN_CPYTHON" might better be spelled as "COMPILING_IN_PYPY else ...". In fact, PYPY has even improved their C-API implementation a lot during the last year, so some of the special casing could even be removed at some point.

If Pyston can handle the normal CPython path, it's best to change the "CPYTHON" check to a "PYPY" check, i.e. swap the default behaviour to CPYTHON and special case PYPY instead, rather than special casing CPYTHON and PYSTON and whatever else might come up in the future.

To be even more clear: I encourage you to be more ambitious in your change and also clean up the current macro usage.

@scoder
Copy link
Copy Markdown
Contributor

scoder commented Jul 30, 2016

I replaced most of the macro usages by more feature-specific macros. Please take a look and see if that helps in what you're doing. 71de578

@scoder
Copy link
Copy Markdown
Contributor

scoder commented Jul 31, 2016

I also added macro indirections for your C-API functions here: 9a3f96e

@Daetalus
Copy link
Copy Markdown
Contributor Author

Daetalus commented Aug 1, 2016

Thanks! I will take a look.

@Daetalus Daetalus force-pushed the pyston_changes branch 2 times, most recently from 2ed68b6 to ee9f1e7 Compare August 1, 2016 11:10
@Daetalus
Copy link
Copy Markdown
Contributor Author

Daetalus commented Aug 1, 2016

Hi @scoder . Thanks for your patches.

Pyston is another Python implementation. More like CPython + JIT. Patch
Cython to add Pyston support.
@Daetalus
Copy link
Copy Markdown
Contributor Author

Daetalus commented Aug 8, 2016

Hi @scoder I updated the commit again. Would you mind to review this commit if you have time, please? Pyston will try to support more CPython extensions. So more Pyston change will come.

@scoder
Copy link
Copy Markdown
Contributor

scoder commented Aug 16, 2016

Looks good. Thanks!

@scoder scoder merged commit 09485f9 into cython:master Aug 16, 2016
@Daetalus
Copy link
Copy Markdown
Contributor Author

Thanks for your help!

NexediGitlab pushed a commit to Nexedi/pycapicompat that referenced this pull request Sep 28, 2016
As of 2016-Sep-28 pycapicompat.h is no longer active because all relevant bits
went into Cython codebase directly: cython/cython#528
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants