pymad / cpymad

cPyMAD is a python interface to Mad-X using cython and libmadx

Home Page:http://cern.ch/pymad

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace Cython by CFFI (?)

coldfix opened this issue · comments

This is just a suggestion to think about.

C Foreign Function Interface (CFFI) provides an alternative way to access C libraries from Python. Compared to Cython, its advantage is that it allows deploying to target systems where there is no C compiler available (or so it says). Especially on windows, this might be a big advantage (I haven't figured out the whole deployment issue for windows yet).

Furthermore, it will allow to just copy the declarations from the C headers, instead of rewriting them into another language (Cython).

On the other hand, it is probably much slower than Cython. It says, it is comparable to ctypes.

I might try it out on a small scale some day to see if behaves nicely.

More bindings to consider:

  • ctypes
  • SWIP

I will close this for now, as the Cython binding works fine for the moment and on windows, wheels (.whl) can be used to install to systems without C compiler, assuming there is a pre-built version for the correct platform.