[mcclim-devel] Freetype and CFFI

Robert P. Goldman rpgoldman at sift.info
Fri Dec 8 14:09:43 UTC 2006


Brian Mastenbrook wrote:
> Robert Goldman wrote:
>> OK.  I stand corrected.  Nevertheless, I argue that a freetype
>> approach based on CFFI, which is portable over non-CMU-derived lisps
>> as well as CMU-derived lisps is preferable, prima facie.
>> Now, there may be some additional considerations that would make the
>> CMU-derived-specific approach better, but I don't know of any.  If you
>> do, please let me know.
>>
>> Note I'm not trying to brag about my code and denigrate others.  All I
>> did was tweak the CMU-derived-specific approach to backend to CFFI
>> instead, a pretty minor change (and one that I did with virtually no
>> understanding of the code.
> 
> To add some historical perspective to the issue:
> 
> The mcclim-freetype code was created by Gilbert Baumann. I did the
> initial conversion to SBCL. This involved more than just changing
> package names; in order to make it usable, the code had to be changed
> such that SBCL no longer warned about runtime calls to %SAP-ALIEN. Not
> only did it worn at compile time about this; it actually generated
> warnings at runtime initially too. Along the way, I added a few caches
> to speed up glyph rendering, which finally resulted in something I could
> bear to use daily in climacs and the listener.
> 
> Making the compiler happy wrt %SAP-ALIEN was not trivial, and if there's
> anything I would be worried about in the CFFI version, it's that
> somewhere one of those optimizations is not implemented. If it's usably
> fast, I guess everything is OK. Not having used CFFI, I don't know if
> SBCL will still warn about these as profusely as it does when using good
> ol' SB-ALIEN.
> 
It's not that easy for me to test with SBCL (at least it's un-easy
enough that I won't be able to get to it until after the start of the
new year).  I'd encourage you to have a whirl at the CFFI version of
Freetype.  I tried not to do anything that would make it not work on
SBCL, but I can't swear that I did it all right...

BTW, I did initially try to make a version of freetype that would use a
bunch of #+ and #- to add ACL support.  It was just too hard for me,
simple differences b/w the two models of foreign function calls foiled
me.  And, of course, even if I had managed it, that still would have
left clisp and lispworks (at least) out in the cold.  I hope that CFFI
will be A Good Thing.  It is for me, anyway, since beirc is now much
prettier!

-- 
Robert P. Goldman
Senior Scientist
Smart Information Flow Technologies (d/b/a SIFT, LLC)

211 N. First St., Suite 300
Minneapolis, MN 55401

Voice:	(612) 384-3454
Email:    rpgoldman at SIFT.info



More information about the mcclim-devel mailing list