On Thu, 2006-01-05 at 00:22 -0800, Keith Irwin wrote:
Is there likely to be a user list for cffi in the near future? If not, is it okay to ask user oriented questions (or provide dumb-user feedback)?
It's certainly fine to ask user questions on this list---since CFFI is still developing and changing rapidly it's probably good to have lots of communication between developers and users. Once things stabilize a bit I'll look into setting up a cffi-users list.
For instance, I was trying to defcstruct the GdkEventKey structure for SBCL, and couldn't use stuff like :uint32 and so on as shown in the manual. So I had to spend a lot of time guessing (and staring at cffi-sbcl.lisp). So, it seems I have to use :char for :gint8 and so on.
Early on in CFFI development, when many things were not implemented yet, I often used the documentation to represent ideas on how I'd like things to look when they are finished. Now that there are folks actually trying to use this thing, that's probably not a good habit.
Patches against the documentation that notice such things and comment out the offending sections (so they can be moved to the TODO list, or other places) would be especially useful.
What confuses me a bit is the C docs. What's the diff between guint and guint32? Since I'm on a 32bit machine, they're the same, right?
Right. When you use a 'guint', you are stating you don't need a specifically sized integer, just a plain ol' native integer will do. A 'guint32' will always be 32 bits, no matter the word size.
Are you planning on mapping more names to the SBCL part of all this? Having something like :unsigned-int32 as well as :unsigned-int would allow me to remain as ignorant as I want to. ;) (Translation: since I deal with word size so rarely, I always have to think hard about it and remember stuff, and that, well, interrupts the flow, you know?)
The reason these types haven't been added so far is that we really need to query the system to determine the appropriate types for each size. Now that I think about it, we should be able add :[u]int{8,16,32,64} by getting the FOREIGN-TYPE-SIZE of the native integer types at load time and setting up the type definitions as necessary. I'll add this to the TODO list.
Okay, well, the work you're doing is fantastic. It's a lot of fun. I might even make cl-browser the minimalist working browser out there, if only to force myself to learn more of the huge GTK api.
Great, thanks! I definitely think cl-browser is cool, if not as competition for Firefox, at least as a good GTK/CFFI example, or a library for inclusion into more complex GTK applications.
James