From: W. Trevor King Date: Sat, 10 Mar 2012 12:36:19 +0000 (-0500) Subject: Add Cython post. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fc4c3e616e75e9bc4e4316153edd49f853353a98;p=blog.git Add Cython post. --- diff --git a/posts/Cython.mdwn b/posts/Cython.mdwn new file mode 100644 index 0000000..53dc372 --- /dev/null +++ b/posts/Cython.mdwn @@ -0,0 +1,30 @@ +[Cython][] is a Python-like language that makes it easy to write +[[C]]-based extensions for [[Python]]. This is a Good Thing™, because +people who will write good Python wrappers will be fluent in Python, +but not necessarily in C. Alternatives like [[SWIG]] allow you to +specify wrappers in a C-like language, which makes thin wrappers easy, +but can lead to a less idomatic wrapper API. I should also point out +[ctypes][], which has the advantage of avoiding compiled wrappers +altogether, at the expense of dealing with linking explicitly in the +Python code. + +The [Cython docs][docs] are fairly extensive, and I found them to be +sufficient for writing my [[pycomedi]] wrapper around the [[Comedi]] +library. One annoying thing was that Cython does not support +`__all__` ([cython-users][]). I took [a stab at fixing this][github], +but got sidetracked cleaning up the Cython parser ([cython-devel][], +[later in cython-devel][later]). I must have bit off more than I +should have, since I eventually ran out of time to work on merging my +code, and the Cython trunk moved off without me ;). + + +[Cython]: http://cython.org/ +[ctypes]: http://docs.python.org/library/ctypes.html +[docs]: http://docs.cython.org/ +[cython-users]: + http://groups.google.com/group/cython-users/browse_thread/thread/a17bb0f5e550c140 +[github]: https://github.com/wking/cython/branches +[cython-devel]: + http://mail.python.org/pipermail/cython-devel/2011-February/000035.html +[later]: + http://mail.python.org/pipermail/cython-devel/2011-March/000163.html diff --git a/posts/pycomedi.mdwn b/posts/pycomedi.mdwn index 3391b4c..77a578d 100644 --- a/posts/pycomedi.mdwn +++ b/posts/pycomedi.mdwn @@ -1,13 +1,11 @@ [[!meta title="pycomedi"]] [[!template id=gitrepo repo=pycomedi]] -I was getting frustrated with [Comedi][]'s [[SWIG]] wrappers, so I -wrote a more object-oriented wrapper using [Cython][]. +I was getting frustrated with [[Comedi]]'s [[SWIG]] wrappers, so I +wrote a more object-oriented wrapper using [[Cython]]. The `README` is posted on the [PyPI page][pypi]. -[Comedi]: http://www.comedi.org/ -[Cython]: http://cython.org/ [pypi]: http://pypi.python.org/pypi/pycomedi/ [[!tag tags/code]]