www.digitalmars.com         C & C++   DMDScript  

D - Python/D

reply Deja Augustine <Deja_member pathlink.com> writes:
Well, I've managed to port over 90% of the Python/C API to D so now you can
extend or embed python using D (the other 10% are threads, some unicode stuff
and several macros, but those'll be put in shortly).

Check it out at http://www.scratch-ware.net/D/
Apr 08 2004
next sibling parent reply "Walter" <walter digitalmars.com> writes:
Since D and Python appeal to the same kinds of programmers, this is great!


"Deja Augustine" <Deja_member pathlink.com> wrote in message
news:c556d1$i2a$1 digitaldaemon.com...
 Well, I've managed to port over 90% of the Python/C API to D so now you

 extend or embed python using D (the other 10% are threads, some unicode

 and several macros, but those'll be put in shortly).

 Check it out at http://www.scratch-ware.net/D/

Apr 08 2004
parent Deja Augustine <Deja_member pathlink.com> writes:
Well, I've gotten Python/D about as far as I'm going to take it. Threads,
Unicode, Frametrace, etc are all in there.  All it's missing are most of the
macros, but the majority of them seem to be merely there for backward
compatibility, so I don't feel like spending the enormous amount of time
required to implement them all.

If you find that a particular macro is missing (and it does more than simply
call a function already provided) or if I've missed or messed up anything,
please feel free to send me an email at D scratch-ware.net

Enjoy!

In article <c558sm$mmb$1 digitaldaemon.com>, Walter says...
Since D and Python appeal to the same kinds of programmers, this is great!


"Deja Augustine" <Deja_member pathlink.com> wrote in message
news:c556d1$i2a$1 digitaldaemon.com...
 Well, I've managed to port over 90% of the Python/C API to D so now you

 extend or embed python using D (the other 10% are threads, some unicode

 and several macros, but those'll be put in shortly).

 Check it out at http://www.scratch-ware.net/D/


Apr 08 2004
prev sibling parent reply "Ben Hinkle" <bhinkle4 juno.com> writes:
I'm curious, does there exist a C++ API to Python? I mean one that takes
advantage of features in C++ that aren't in C. I wonder how seamless it can
be from either D or C++.

-Ben

"Deja Augustine" <Deja_member pathlink.com> wrote in message
news:c556d1$i2a$1 digitaldaemon.com...
 Well, I've managed to port over 90% of the Python/C API to D so now you

 extend or embed python using D (the other 10% are threads, some unicode

 and several macros, but those'll be put in shortly).

 Check it out at http://www.scratch-ware.net/D/

Apr 09 2004
parent reply Ilya Minkov <minkov cs.tum.edu> writes:
Ben Hinkle schrieb:
 I'm curious, does there exist a C++ API to Python? I mean one that takes
 advantage of features in C++ that aren't in C. I wonder how seamless it can
 be from either D or C++.

There's one in Boost which has caused major headache to DMC and some other compilers. I can't remember exactly, i think the issues with DMC have been resolved now. I've never tried it though. -eye
Apr 09 2004
parent reply Deja Augustine <Deja_member pathlink.com> writes:
I don't imagine it would be that difficult to write a Python wrapper in D.  It's
been my experience that it's frequently more beneficial to write a new version
of a wrapper from scratch using D than to port it over from C++ as then you can
more readily utilize the features of D that make it worth doing in the first
place.

Also, as a side note, I realized that I had missed a few predefined variables
(such as Py_None and the predefined exception types like PyExc_IOError) so those
have been added.  

Please download the latest version at http://www.scratch-ware.net/D/

In article <c56s1e$7kb$1 digitaldaemon.com>, Ilya Minkov says...
Ben Hinkle schrieb:
 I'm curious, does there exist a C++ API to Python? I mean one that takes
 advantage of features in C++ that aren't in C. I wonder how seamless it can
 be from either D or C++.

There's one in Boost which has caused major headache to DMC and some other compilers. I can't remember exactly, i think the issues with DMC have been resolved now. I've never tried it though. -eye

Apr 09 2004
parent Deja Augustine <Deja_member pathlink.com> writes:
There was an error in the object structure and the refcounting wasn't working
causing the Py_Finalize() function to give an access error.

This has been fixed and Python/D works flawlessly for both embedding and
extending (see the site for examples of both)

http://www.scratch-ware.net/D/
Apr 09 2004