I recently used Ruby/DL to create bindings to the SQLite3 embedded
database engine. In doing so, I found that the Ruby/DL library is not
quite up to the task. _why encouraged me to post to ruby-core to see
if these issues might be resolvable.

1) There is no way to support 64-bit integer return values with
   Ruby/DL. Without that support, the SQLite3 bindings are unusable by
   any library that needs to get the id of the last inserted row (like
   ActiveRecord).

2) Hard-coded limit to the number of callbacks. SQLite3 alone uses
   five or six callbacks. If SQLite3 were to be used in conjunction
   with other libraries that _also_ used callbacks, there could be
   problems. (I know that the number of callbacks can be specified
   when Ruby/DL is built, but the default of 10--which most people
   will be using--is small enough to be potentially problematic.
   Upping that to 20 or 30 as the default would help, but it would be
   nice to find a way to do away with the hard-coded limit
   altogether.)

3) "const char*" as a return value is handled "correctly" (which is to
   say, the return value is never freed by Ruby). Any other "const"
   pointer return type ("const void*", "const int*", etc.) is not
   handled the same way--the caller must explicitly remove the "free"
   handler from the pointer to prevent Ruby from freeing the pointer
   when it is garbage collected. It would be nice if this case were
   handled more consistently--either always requiring the explicit
   removal of the free handler from const pointer return types, or
   always performing that task for the caller.

I also encountered frequent deadlocks and segfaults when using my
SQLite3 bindings with WEBrick. I admit that this could have been my
fault, due to some bug in my own code, but I've never had this happen
except for when I used by Ruby/DL-based bindings.

Can anything be done to "fix" Ruby/DL to handle the above situations?
I tried hacking the 64-bit integer support into it, but the code was
not well documented and it appeared the changes would have to be made
in multiple places. I frankly got lost trying to find my way around.
:(

Help! :)

Thanks,

Jamis

-- 
Jamis Buck
jamis_buck / byu.edu
http://www.jamisbuck.org/jamis
------------------------------
"I am Victor of Borge. You will be assimil-nine-ed."