Wednesday, March 29, 2006

Ideas for a Lisp FFI wiki

A person named “Sacha” recently made the following comment on c.l.l in a thread entitled “CLISP and win32 clipboard access”:

> I've been recently working a lot with .NET, and found
> to be very usefull.
> This web site is providing the .NET world equivalent to FFI for win32 calls.
> Wouldn't it be very nice to have such a wiki for FFIs ?

Yeah, I think there are several features of that could/should be replicated in a Lisp FFI wiki:

  • entries for

  • data structures and immediate types

  • function signatures

  • consistent structure across each entry

  • summary

  • complete FFI definition that you can copy&paste

  • perhaps for just CFFI?

  • usage notes or gotchas

  • example code

  • alternatives, if any, for the current entry

  • pointer to relevant doc in the native library (e.g., ImageMagick manual, Gtk+ manual, MSDN, etc)

  • FAQ

  • pros and cons of the various FFIs

  • address SWIG, Verrazano, and other automation tools

  • search

  • a search engine that has a decent syntax and the ability to constrain the search to specific areas (e.g., Google's group: modifier)
In other words, not a jumble of info thrown together, but an organized format that has had some thought put into it. To be useful, this wiki would have to be fairly extensive.

One other crazy thought I had about this is if the wiki was organized via tags a la rather than (or in addition to) a hierarchy. I’d bet that would be especially handy for folks implementing portability layers. E.g., you could search on the combination of “window” and “creation” tags to see FFI definitions for window creation functions in the various UI libraries.

Tuesday, March 21, 2006

Graphic-Forms 0.2.0 released

The first release of Graphic-Forms (version 0.2.0), a CL library for Windows GUI programming, is now available. This is definitely pre-alpha code, so be prepared for missing features, bugs, and API changes in subsequent releases.

Download a release tarball from here:

Please consult README.txt for specific details about this release.

The main project website is:

Sunday, March 19, 2006


In preparation for releasing version 0.2.0 of Graphic-Forms, I’ve uploaded screenshots:

Saturday, March 18, 2006

A couple more items

Following up on the prior entry, here are a couple more motivations for library implementers:
menu accelerator key tables

Motivation for GUI Library development

One of the jobs of a GUI library is to enhance programmer productivity. Any such library having pretensions of being useful for real-world applications necessarily has to provide abstractions over system-level APIs. The system provides building blocks that the library organizes.

With that in mind, I think a GUI library for the MS Windows environment (Win32) has to tackle issues including but not limited to:
  • graphics:

    • bitmap transparency

    • manipulation of non-native image formats

    • scrolling

  • facilitation of multi-threaded applications

    • providing mechanisms for worker threads to safely communicate with event threads

  • construction and inspection of complex structures (e.g., child window hierarchies, menus, and table and tree controls)

    • structure definition

    • efficient modification (especially minimizing redrawing/flashing)

    • tab traversal in non-dialog windows

    • layout management

  • internationalization

    • resource externalization (e.g., strings and data formatting)

    • layout management comes into play here as well

  • smoothing over inconsistencies, bugs, or misfeatures

    • in particular, exposing functionality in a way that makes for the target programming language
Obviously, all of the above can be accomplished by writing directly to the Win32 APIs (since that is how such a library is implemented). But the above features are not directly enabled by Win32, so the application programmer without any GUI library has to implement them or go without.

I would claim that if you’re serious about GUI development, then the above is a subset of the functionality with which you need to be concerned.