Now that the portability issues of the mplib have been passed to its author who promised to look into that, I can take a little break from that.
Instead I have indeed started with the AA-lib port to XS. It's a most satisfying work now that I have finally grokked how typemaps work. With the help of these a C-lib basically transforms very nicely into an object-oriented Perl lib. A method that sets a pixel in the output is not more than a finger-snip:
pixel (self, x, y, color)
aa_putpixel(self, x, y, color);
$aa->pixel(1, 1, $color) and it's done.
And here's the occasional rant: Why don't the XS-docs describe a very easy thing in an easy manner? Till yesterday I thought the typemap would have to translate a C-structure into the equivalent blessed Perl-hash and vice versa. Naturally, with this misconception in mind it's hard to understand the rest of perlxs.pod.
I finally found it out with the help of Dean Roehrich's CookBookA that he has released on CPAN. Mind you, this one doesn't exactly have nice explanations either. It was one sentence that dawned a light on me:
Ex1 demonstrates how to write a Perl constructor in C.
The constructor allocates a C structure and creates an
opaque Perl object to hold an address to the structure.
'hold an address to the structure': That's the sub-sentence that explained Life, the Universe and Everything.