summaryrefslogtreecommitdiffstats
path: root/kyrias_website/entries/cffi-alpm-a-new-hope.rst
blob: 9ad5f45a147c14cf862dfe498c8df6df4eb1a1c3 (plain)
1
2
3
4
5
6
7
title: "cffi-alpm: A New Hope"
date: 2016-11-17
tags: ['python', 'libalpm']

Pyalpm has some annoyances to it, like leaking a lot of memory, and being a CPython module.  It has many times been suggested that it should be re-written using CFFI or something similar though, and tonight I’ve been pretending that I don’t have anything better to do, so I started playing with CFFI and libalpm a bit.

The result of my experimentations is available at `cffi-alpm <https://github.com/kyrias/cffi-alpm>`_, though it’s not particularly useful yet.  Right now it has a class that wraps `alpm_list_t` and implements the Python `iterator protocol <https://www.python.org/dev/peps/pep-0234/>`_ for it, and have written a small example that searches the local DB.  It’s not really much at all, but I do feel like I have a better feel of both CFFI and libalpm now, and might actually end up writing a complete pyalpm replacement.