Wednesday, July 9, 2008

Fundamentals of the Lisp Universe

When I was younger I used to devour science fiction. For a while I read a lot of H. P. Lovecraft. In one of his stories he describes an artifact:

"The longer I looked, the more the thing fascinated me; and in this fascination there was a curiously disturbing element hardly to be classified or accounted for. At first I decided that it was the queer other-worldly quality of the art which made me uneasy. All other art objects I had ever seen either belonged to some known racial or national stream, or else were consciously modernistic defiances of every recognized stream. This tiara was neither. It clearly belonged to some settled technique of infinite maturity and perfection, yet that technique was utterly remote from any - Eastern or Western, ancient or modern - which I had ever heard of or seen exemplified. It was as if the workmanship were that of another planet."

-"The Shadow Over Innsmouth"


Lisp is like this for me. Being older than almost every other language, it comes from a fundamentally different place. It holds a software culture that is different from any other. Some of these things are small, like the use of parentheses. Others are larger, functional programming. Others are just plain alien, like macro writing macros and functions generating functions. I'm still trying to learn all the functions available to me. Most of the time when I try to do something I find there is already a tool there for what I needed to do. Yes, I can read the Hyperspec, but I don't always understand the nuances of it. Other times I can't understand the rational for something. That makes understanding Lisp a lot like unraveling a mystery.

Last night I almost finished my CFFI bindings for Cairo. I know others exist but I wanted a library to learn from. I used cl-cairo to help me when I got stuck, so thank you, oh, nameless one who made it. (If I could find the name I would have given credit!) Now I just have to implement a few things in the cl-opengl library and create a Pango and a pixbuf library and I should be close to everything I need external to my program. I do have one issue, however, I have to coerce my values to doubles, which CFFI doesn't like. I've tried making a translate-to-foreign hook but that isn't working yet. I got tired before I figured out why it was failing. Tonight I have plans and can't work on it but tomorrow I hope to fix that, add some error handling and start the Pango bindings. If they work, I'll send them to cliki.

No comments:

Post a Comment