Functional programming

A suggested that it would be helpful to have a short primer on the basics of functional programming for the imperative programmer coming to newLISP (although this also applies to other Lisps). Read more…

Sep 10th, 2007 | Filed under Programming
Tags:

Faster string iteration using unpack

In a previous entry, we used a simple C program and SWIG to extend Python. This was because iteration over Python’s strings, being more complex constructs than C’s character arrays, was not speedy enough for large strings. newLisp, being a high level, interpreted language like Python, also suffers from the same problem. However, newLisp’s unpack function provides another option. Read more…

Aug 23rd, 2007 | Filed under Programming
Tags:

Writing Python modules in C with SWIG

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. Read more…

Aug 14th, 2007 | Filed under Programming
Tags: ,

Updating the newLISP MySQL5 module

It has been a very busy few weeks here. This is the time of year when work gets very rushed, and on top of that, my wife and I are expecting. Due to all of that, I have decided against finishing the C Libraries tutorial for newLisp at this time. The reason that I had worked on it to begin with was to attempt a better MySQL module than the current mysql5.lsp module that comes with the newLisp distribution, but due to time constraints, I have instead written some alterations to the current one that provide many of the same features that I was looking for initially, and fixing a few of the more superficial and crucial problems that I found in the library (in particular, fetch-all’s habit of leaving around old result sets without clearing the data by using a context-global variable for storage, rather than a local variable). Read more…

Aug 1st, 2007 | Filed under Programming
Tags: ,

Using C libraries in newLISP

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. Read more…

Jul 14th, 2007 | Filed under Programming
Tags: ,