articles filed under C
Making 64-bit MySQL work with newLISP
posted on 07/24/08 at 12:49 p.m. |
|
For the past few days have been spent trying to get the newLISP MySQL module to work with the 64-bit version of the libmysqlclient library. Here is what I did to get things working properly.
Extending Python with (almost) anything
posted on 03/24/08 at 2:42 p.m. |
|
Among the various methods of extending Python about which I have written, Python 2.5's ctypes module is possibly the easiest.
Extending Python with Pyrex
posted on 10/23/07 at 1:20 p.m. |
|
In a previous entry, I showed how to extend Python without directly using the Python C using SWIG. SWIG parses an interface file written by the programmer and then outputs a wrapper module. A more elegant, more pythonic solution might be a parser which allows a C module to be written directly in Python. Pyrex lets you write your extension module in a Python-like syntax that compiles to C. The C module can then by compiled using distutils (or gcc, et al) to a binary Python module.
Writing Python modules in C with SWIG
posted on 08/14/07 at 9:53 a.m. |
|
The Python C API, while very well put together, is still C and therefore requires a lot of time an effort to understand, let alone use. But every now and then, a programmer comes across something that is either impossible in Python or so prohibitively expensive performance-wise that it is worth dusting off the old C textbook.
Using C libraries in newLISP
posted on 07/14/07 at 10:43 a.m. |
|
The past couple of articles have been tutorials on how to use CFFI to access functions from C libraries in Lisp. Out of completeness, I thought I'd write a short tutorial demonstrating how much easier it is to do the same thing in newLisp. As newLisp is an entirely interpreted language, this built in functionality allows very easy extension of the language using much more low level and efficient libraries.
Wrapping a C library in lisp (part 2)
posted on 07/03/07 at 7:53 p.m. |
|
Once the library has been defined and loaded into the Lisp image, work can begin on defining C routines in Lisp.
Before that can be done, however, a note for those who do not know C...
Wrapping a C library in lisp (part 1)
posted on 07/02/07 at 2:06 p.m. |
|
One of the more significant difficulties I face when developing Lisp applications is the apparent lack of generally compatable database libraries for the various lisp dialects. CLSQL is a nice solution, but it does not get along well on OSX, my development OS, or with CLISP, which is the primary lisp dialect I have available on my host...
Using CFFI, we can fairly easily create mappings for the most important MySQL C api functions. This entry will walk through the process of importing the library; future entries will go one to defining a few of the most basic routines for our lisp image.