Archives
-
Multi-threading in Python
Programming with threads is one of the more difficult tasks in programming. The Python threading and Queue modules make this significantly easier, but it still takes some deliberation to use threads in an efficient way. Submit article
Nov 30th, 2007 | Filed under Programming -
Extending Python with Pyrex
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 [...]
Oct 23rd, 2007 | Filed under Programming -
Concurrency in newLISP
Threaded applications are considered to be so difficult to implement properly that programmers are often encouraged to avoid them unless absolutely necessary. This is because of the difficulty in synchronizing data between threads. There are several techniques to accomplish this. Typical solutions involve sharing an area of memory or a pipe (a channel that maps [...]
Sep 18th, 2007 | Filed under Programming -
Functional programming
A recent post on the newLISP forum 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). Submit article
Sep 10th, 2007 | Filed under ProgrammingTags: functional -
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 [...]
Aug 23rd, 2007 | Filed under ProgrammingTags: newlisp