MySQL
Poor Man's MySQL API for Gambit-C
By Arto on Sun, 2006-06-11 20:00. API | Gambit | hacks | Lisp | MySQL | SchemeLately I’ve been familiarizing myself with Gambit-C. This has mostly been preparatory work in anticipation of the imminent release of Termite, Guillaume Germain distributed computing system inspired by Erlang and implemented using Gambit’s serializable continuations and lightweight processes, scalable up to millions of concurrent threads.
Gambit is definitely one of the more interesting Scheme implementations out there, not to mention among the fastest; its creator Marc Feeley has been described as a performance junkie, and according to the Gambit manual, “with appropriate declarations in the source code the executable programs generated by the compiler run roughly as fast as equivalent C programs.”
However, despite its technical excellence, Gambit doesn’t, as of yet, have much of a standard library.
Yesterday I needed to interface Gambit with MySQL, and couldn’t find any existing binding to let me do that (though an SQLite 2.x interface does exist). As I wasn’t familiar enough with Gambit’s FFI system, I took the über-simple, lazy man’s approach: I created a trivial wrapper API on top of the mysql and mysqladmin command line utilities.
