Hi!

I'm Python noob and got info that SWIG (which I know for quite some time
when playing with Ruby) does not produce best bindings for C libs and
was advised to go with ctype.

However, some research has brought me to Cython and now I'm considering
if it is the right tool for the (potential) task - writing bindings for
Swiss Ephemeris C lib (http://www.astro.com/swisseph/swephprg.htm)

We need it for writing astrological software and although the plan
was/is to use Haskell as the main language, I'm curious if Python with
Cython could provide good-enough performance for the application (GUI
with GTK+, sqlite3 back-end etc.). IOW, Cython could be used not only
for writing Python bindings for C lib, but for some other code as well.

However, first things first, and in order to do any testing, we need
nice Pythonic bindings for C lib which has API looking like follows:

int swe_calc_ut ( double tjd_ut, int ipl, int iflag, double* xx, char* serr),

where

tjd_ut=Julian day, Universal Time

ipl=body number

iflag=a 32 bit integer containing bit flags that indicate what kind of
computation is wanted

xx=array of 6 doubles for longitude, latitude, distance, speed in long.,
speed in lat., and speed in dist.

serr[256] =character string to return error messages in case of error.

In case when return value is < 0, *serr contains error message.

(See http://www.astro.com/swisseph/swephprg.htm#_Toc207617937)

The rest of the API is done in the same way and the whole lib includes
several *.c files and one header swephexp.h.


Anyone can give me some advice whether Cython is good tool for such
task(s)?


p.s. There is already one extension for Swiss Ephemeris lib
(http://pyswisseph.atarax.org/pydoc/index.html) but I believe with
Cython one could produce nicer API.


Sincerely,
Gour

 
-- 

Gour  | Zagreb, Croatia  | GPG key: C6E7162D
----------------------------------------------------------------

Attachment: pgptY5uQgk39V.pgp
Description: PGP signature

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to