Python calling D

CJS Prometheus85 at hotmail.com
Sun Jan 19 18:30:44 PST 2014


> Sorry to be late coming to this.
>
> It would great to be able to push D as a CPython extension 
> language.
> However the state of pyd.dsource.org and places reached from it 
> do make
> it seem that the project died in 2009.
>
> ariovistus' GitHub project on Bitbucket is moving but 
> everything else
> appears to be a problem.
>
> Is it possible to decide on a location for activity, create some
> infrastructure, and then get the old stuff cleaned out.
>
> My start point is to get PyD working in virtualenvs for Python 
> 2.7 and
> Python 3.3. Findout out what the SCons and Tup stuff is for 
> would be
> useful. On the side I could help with documentation and stuff, 
> but only
> if it can be done by DVCS and pull requests with email, I am not
> interested in non DVCS wikis nor forums.

For future reference, I tried but wasn't able to make calling D 
from python work. I tried to just compile D to an .a library, 
including statically linking phobos, and then wrapping it with 
cython like I would with C code. (I've made this work before with 
C.)

My thinking was that there's already been a lot of work in the 
Python world in the past 4-6 years to make calling C fairly 
straight forward. So D should be able to piggy back on that work.

(Though to a lot of Python people a legitimate question would be, 
"is this worth it?" You can just profile python code to find the 
hot spots and then use ctypes/cython to pass objects allocated by 
Python to C-level functions to do the time-intensive stuff.)


More information about the Digitalmars-d-learn mailing list