July 2010 Archives

Following convention across language boundaries

I've been meaning to write this post for a while. I'd like your opinion on it.

Thoughts on a Ctypes::Type object API

For the past few days I've been considering and experimenting with the design of simple Ctypes::Type objects. These are objects which, funnily enough, represent C data types for manipulation in Perl.

Looking at the Python ctypes module, there were various things I didn't like. Python's simple types [0] can be summarized thusly:

>>> i = c_int(42)
>>> print i
>>> print i.value
>>> i.value = -99
>>> print i.value

Having to specify …

Callbacks done, weird 64bit libffi issue?

The week has been frustrating, funny, yet ultimately fruitful.

I had callbacks to Perl almost working at the start of the week, but couldn't seem to get variables updated 'in place'. The example function I was using to test callbacks, the C standard qsort, takes as its arguments a pointer to an array, the number of items in the array, the size in bytes of one item, and a reference to a function which will be passed two items from the array at a time and decide how to sort them. It returns void, and the …

GSoC Update: New objects, Perl callbacks

July already - where has the time gone? Oh wait, Twitter can tell me.

In the wake of my last blog post, rurban told me Magic was more of a 'last resort', and that everything necessary for making type objects could be done with perl's pack and unpack functions, which precipitated a day or two experimenting and trying to get …

About doubi

user-pic Student perl-lover in the UK, finishing my law degree in June.