Re: Python calling D

2014-02-06 Thread Ellery Newcomer
On Tuesday, 4 February 2014 at 16:17:30 UTC, Russel Winder wrote: On Tue, 2014-02-04 at 12:45 +, Artem Tarasov wrote: But it does lead to a working system :-) Any particular reason you aren't using CeleriD to build this shared lib? CeleriD uses some hooks to call rt_init when the library

Re: Python calling D

2014-02-04 Thread Russel Winder
On Tue, 2014-02-04 at 12:45 +, Artem Tarasov wrote: > On Tuesday, 4 February 2014 at 11:33:40 UTC, Russel Winder wrote: > > The question is how to get this run. > > Pointing out obvious things, part 2: wrap it into a C function > and call that function when loading the Python module. I had t

Re: Python calling D

2014-02-04 Thread Artem Tarasov
On Tuesday, 4 February 2014 at 11:33:40 UTC, Russel Winder wrote: The question is how to get this run. Pointing out obvious things, part 2: wrap it into a C function and call that function when loading the Python module. library.d: ... extern (C) export void attach() { Runtime.initialize();

Re: Python calling D

2014-02-04 Thread Russel Winder
On Tue, 2014-02-04 at 07:13 +, Artem Tarasov wrote: > On Sunday, 2 February 2014 at 15:31:30 UTC, Russel Winder wrote: > > result is: > > > > |> LD_LIBRARY_PATH=. python execute.py > > Segmentation fault > > You should call Runtime.initialize() prior to calling any other D > f

Re: Python calling D

2014-02-03 Thread Artem Tarasov
On Sunday, 2 February 2014 at 15:31:30 UTC, Russel Winder wrote: result is: |> LD_LIBRARY_PATH=. python execute.py Segmentation fault You should call Runtime.initialize() prior to calling any other D functions.

Re: Python calling D

2014-02-02 Thread Russel Winder
On Sun, 2014-02-02 at 01:07 +, Ellery Newcomer wrote: > On Saturday, 1 February 2014 at 22:02:24 UTC, Russel Winder wrote: > > > > My problem of the moment is segmentation faults during > > execution, and I > > have no model of how to go about providing useful data to debug > > this :-(( > >

Re: Python calling D

2014-02-01 Thread Ellery Newcomer
On Saturday, 1 February 2014 at 22:02:24 UTC, Russel Winder wrote: My problem of the moment is segmentation faults during execution, and I have no model of how to go about providing useful data to debug this :-(( It wouldn't by any chance be related to https://bitbucket.org/ariovistus/pyd/i

Re: Python calling D

2014-02-01 Thread Russel Winder
On Sat, 2014-02-01 at 20:58 +, Ellery Newcomer wrote: > On Sunday, 26 January 2014 at 14:17:18 UTC, Russel Winder wrote: > > On Sun, 2014-01-26 at 12:11 +, Russel Winder wrote: > > […] > >> However with Python 2 the example from: > >> > >>https://bitbucket.org/ariovistus/pyd/wiki/Quick

Re: Python calling D

2014-02-01 Thread Ellery Newcomer
On Sunday, 26 January 2014 at 14:17:18 UTC, Russel Winder wrote: On Sun, 2014-01-26 at 12:11 +, Russel Winder wrote: […] However with Python 2 the example from: https://bitbucket.org/ariovistus/pyd/wiki/QuickStart leads to: This all sounds suspiciously like stuff I thought I'd alread

Re: Python calling D

2014-01-26 Thread Russel Winder
On Sun, 2014-01-26 at 12:11 +, Russel Winder wrote: […] > However with Python 2 the example from: > >https://bitbucket.org/ariovistus/pyd/wiki/QuickStart > > leads to: > > |> python setup.py build > Traceback (most recent call last): > File "setup.py", line 11, in > d_lump=True >

Re: Python calling D

2014-01-26 Thread Russel Winder
On Sun, 2014-01-26 at 01:33 +, Ellery Newcomer wrote: > On Friday, 24 January 2014 at 10:55:34 UTC, Russel Winder wrote: > > > > Probably want to use a virtualenv for this rather than install > > into the > > base installation > > > > you can also do > > python setup.py build > python runtes

Re: Python calling D

2014-01-25 Thread Ellery Newcomer
On Friday, 24 January 2014 at 10:55:34 UTC, Russel Winder wrote: Probably want to use a virtualenv for this rather than install into the base installation you can also do python setup.py build python runtests.py -b hello It needs to work for Python 3.3 as well! try the latest commit

Re: Python calling D

2014-01-24 Thread Russel Winder
On Fri, 2014-01-24 at 02:29 +, Ellery Newcomer wrote: […] I have just tried a trivial D source shared object on Debian Unstable using DMD 2.064.2 from d-apt. Compile up the shared object with entries C linkage, try to use ctypes or CFFI from Python just gives a segmentation violation :-( > py

Re: Python calling D

2014-01-23 Thread Ellery Newcomer
On Monday, 20 January 2014 at 02:30:46 UTC, CJS wrote: 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

Re: Python calling D

2014-01-19 Thread CJS
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

Re: Python calling D

2014-01-19 Thread Russel Winder
On Wed, 2013-12-11 at 12:56 +0100, John Colvin wrote: > On Wednesday, 11 December 2013 at 11:41:11 UTC, Chris wrote: […] > > Have you had a look at this: > > > > http://pyd.dsource.org/ > > https://github.com/dansanduleac/pyd > > both of those are out of date, this is where development is now: >

Re: Python calling D

2013-12-11 Thread John Colvin
On Wednesday, 11 December 2013 at 05:30:49 UTC, CJS wrote: I'd like to use cython to wrap a D library. It's possible to do this with a statically compiled C library, but it fails when I try with a statically compiled D library. Any suggestions on how to do this successfully? 1) have you decla

Re: Python calling D

2013-12-11 Thread John Colvin
On Wednesday, 11 December 2013 at 11:41:11 UTC, Chris wrote: On Wednesday, 11 December 2013 at 05:30:49 UTC, CJS wrote: I'd like to use cython to wrap a D library. It's possible to do this with a statically compiled C library, but it fails when I try with a statically compiled D library. Any s

Re: Python calling D

2013-12-11 Thread Chris
On Wednesday, 11 December 2013 at 05:30:49 UTC, CJS wrote: I'd like to use cython to wrap a D library. It's possible to do this with a statically compiled C library, but it fails when I try with a statically compiled D library. Any suggestions on how to do this successfully? Have you had a lo

Re: Python calling D

2013-12-11 Thread FreeSlave
On Wednesday, 11 December 2013 at 05:30:49 UTC, CJS wrote: I'd like to use cython to wrap a D library. It's possible to do this with a statically compiled C library, but it fails when I try with a statically compiled D library. Any suggestions on how to do this successfully? I'm not Cython gu

Python calling D

2013-12-10 Thread CJS
I'd like to use cython to wrap a D library. It's possible to do this with a statically compiled C library, but it fails when I try with a statically compiled D library. Any suggestions on how to do this successfully?