FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Embeding

 
Post new topic   Reply to topic     Forum Index -> PyD
View previous topic :: View next topic  
Author Message
bobef



Joined: 05 Jun 2005
Posts: 269

PostPosted: Tue Jan 16, 2007 10:02 am    Post subject: Embeding Reply with quote

I was looking at pyd.dsource.org and I couldn't see anything about running python scripts from D and interaction between the two. Is such thing possible and do you know how python's performance compares to DMDScript?
Back to top
View user's profile Send private message
KirkMcDonald



Joined: 22 Jun 2006
Posts: 23

PostPosted: Wed Jan 17, 2007 11:22 pm    Post subject: Reply with quote

At the moment, you must use the raw Python/C API for embedding, although Pyd provides some useful utility functions (_py and d_type are the big ones). I do plan to improve this eventually. The PydObject class is the first step for embedding support, though it is unfinished.

The other issue with embedding is building it: Pyd is a little tricky to build manually. I've been messing with DSSS as a build solution, but it's a couple features short at the moment. I've been talking with Gregor about it, though, and it should be usable for this at some point.

As for performance, I don't have any numbers on that.
Back to top
View user's profile Send private message
dyh



Joined: 22 Jan 2006
Posts: 2

PostPosted: Tue Feb 13, 2007 8:35 am    Post subject: Reply with quote

I am looking for embedding python into D too. I'm interested in Stackless in particular.
_________________
serg.
Back to top
View user's profile Send private message
Digited



Joined: 30 Oct 2007
Posts: 19

PostPosted: Wed Jan 09, 2008 3:45 am    Post subject: Reply with quote

I'm also interested in embedding python in D program completely (with python .lib to run scripts even if python isn't installed). Any changes since february?
Back to top
View user's profile Send private message
Digited



Joined: 30 Oct 2007
Posts: 19

PostPosted: Fri Jan 11, 2008 10:26 am    Post subject: Reply with quote

Can anyone post an example of embedding python to a D program? I look at python.d api header and just don't know where to start from... Does PyD object wrapping work with embedding?
Back to top
View user's profile Send private message
KirkMcDonald



Joined: 22 Jun 2006
Posts: 23

PostPosted: Sun Jan 13, 2008 4:16 am    Post subject: Reply with quote

For the most part, you'll want to follow the C tutorial, even in D. The python.d file just contains the bindings to the regular Python/C API. This API looks mostly the same in D as it does in C, with a few minor differences owing to the differences between the two languages.

Pyd class and function wrapping do not really work when embedding. (Though supporting them is certainly possible, and I'll get around to it eventually.) I simply haven't worked much with embedding Python in D, apart from building a trivial "hello world" example ages upon ages ago.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> PyD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group