You might want to look at ctypesgen http://code.google.com/p/ctypesgen/, I found it quite good at generating a minimal representation of a C interface, I don't think they support C++ though. You will probably want to write a more pythonic wrapper that calls down to the generated interface to avoid importing ctypes everywhere in your calling programs. Scott
From: [email protected] [mailto:[email protected]] On Behalf Of Gábor Csárdi Sent: Tuesday, March 18, 2014 6:03 AM To: Shaifali Agrawal Cc: Help for igraph users Subject: Re: [igraph] Original language of igraph and its porting to other languages Well, there is no "correct" way to do this, I guess. Personally I would not use swig at all, because its generated interface seems bloated, at least for R. Maybe it is better for Python. It is actually high time somebody writes a new interface generator, now that libclang is available it should not be too hard, actually. Gabor On Tue, Mar 18, 2014 at 4:42 AM, Shaifali Agrawal <[email protected]<mailto:[email protected]>> wrote: All right; Thanks a lot! So in my project I should also do the same first generate a low level interface using SWIG and than make that interface a perfect wrapper with the help of target language. Again Thank You!! On Mon, Mar 17, 2014 at 4:22 PM, Tamás Nepusz <[email protected]<mailto:[email protected]>> wrote: Yup, Gábor is correct, the Python interface is handcrafted. Theoretically, the script we use to generate the R interface could also be used to generate the Python interface but I have never found enough spare time to replace my existing code with the one generated by the generator so it looks like it's here to stay. For what it's worth, the interfaces that SWIG and alike generate from C code are usually kind of brittle, so my experience is that it is usually easier to generate a "low-level" interface with SWIG and then wrap it with a high level interface that fits more into the host language. To some extent, this is also what I do with the Python interface: the handcrafted C code compiles into a hidden module named igraph._igraph, and the "main" igraph module imports almost all the stuff from igraph._igraph and then wraps some functions that are too cumbersome to use with their original (C-like) interface. -- T. ------------------------------------------------------ From: Gábor Csárdi [email protected]<mailto:[email protected]> Reply: Help for igraph users [email protected]<mailto:[email protected]> Date: 17 March 2014 at 01:28:11 To: Help for igraph users [email protected]<mailto:[email protected]> Subject: Re: [igraph] Original language of igraph and its porting to other languages > Hi, we don't use SWIG. Much of the R interface is generated by a Python > script we wrote. The Python interface is totally hand-written, AFAIK. > > See the sources at https://github.com/igraph/igraph, the develop tree is > most recent. > > Best, > Gabor > > > On Sun, Mar 16, 2014 at 5:09 PM, Shaifali Agrawal < > [email protected]<mailto:[email protected]>> wrote: > > > Hello igraph developers > > > > Oriignal language in which igraph is written are C/C++(right?) as > > mentioned on wiki page . I wanted to know how > > you people manage to port C/C++ code to other languages like Python, Ruby, > > R. Have you used SWIG which work for many other > > languages or diffrint lib/tool for different languages like for Python we > > have Boost.Python, PypiRobin , > > tradtional C++ embedding http://docs.python.org/2/extending/extending.html, > > etc.I want to know process of binding for each language and specifically > > for Python. I need this for one of my project in which want to do same. > > > > > > -- > > Thanks > > > > > > _______________________________________________ > > igraph-help mailing list > > [email protected]<mailto:[email protected]> > > https://lists.nongnu.org/mailman/listinfo/igraph-help > > > > > _______________________________________________ > igraph-help mailing list > [email protected]<mailto:[email protected]> > https://lists.nongnu.org/mailman/listinfo/igraph-help > _______________________________________________ igraph-help mailing list [email protected]<mailto:[email protected]> https://lists.nongnu.org/mailman/listinfo/igraph-help -- Thanks
_______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
