articles filed under newLISP
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.
In defense of newLISP
posted on 07/15/08 at 10:25 a.m. |
|
newLISP receives an unexpected level of hostility from lispers. Languages like Arc and newLISP share an enmity from the assumption that these languages are in some way attempting to unseat Common Lisp. This is not the case.
SQL library for newLISP
posted on 07/14/08 at 4:24 p.m. |
|
The newLISP SQL library is a set of classes and functions to ease generation of SQL code in newLISP. The module is not yet feature-complete but is in a usable state.
newLISP modules section
posted on 07/08/08 at 2:49 p.m. |
|
I have added a new area to the site specifically for newLISP modules. I am in the process of documenting all of my libraries and adding them to that page.
Locking with semaphores in newLISP
posted on 06/04/08 at 2:46 p.m. |
|
Recent development version of newLISP have a new forking mechanism that makes spawning new processes and collecting the results much simpler.
However, for long-running processes that intermittently access shared data (for example, using the (share) function), semaphores are used to lock that data.
newLISP to get Cilk-style concurrency
posted on 04/03/08 at 1:12 p.m. |
|
Multi-processing in newLISP can be a chore. All processes must be directly known to any others that will be accessing shared memory, which must be synchronized using semaphores. A new development release of newLISP (9.3.7) will change all that by adding Cilk-style primitives.
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.
newLISP-mode updated
posted on 03/12/08 at 3:07 p.m. |
|
Tim Johnson has updated his emacs newLISP-mode. I've added a few customizations and posted them in projects.
Variable-arity functions in Lisp
posted on 02/27/08 at 2:36 p.m. |
|
One of the handier features of modern functional languages like Erlang and OCaml is the use of unification to match arity against function definitions. The ability to define a function in terms of the type and number of arguments passed is both expressive and useful.
newLISP Template System
posted on 02/26/08 at 10:19 a.m. |
|
The newLISP template module is inspired largely by the Django template system. Separating complex logic from the template itself leads to both cleaner code and, much more importantly, a simpler system for non-programmers. A content producer should not be required to know lisp to write a simple template.
Request and Response modules for newLISP
posted on 02/22/08 at 2:18 p.m. |
|
A coherent replacement for the default newLISP CGI module. These modules encapsulate CGI functionality for newLISP applications.
What is FOOP?
posted on 02/05/08 at 3:18 p.m. |
|
FOOP is the concept of functional object oriented programming in newLISP. It originated in a thread on the newLISP forum and was officially added to the interpreter for newLISP 9.3.
Working with XML in newLISP
posted on 02/05/08 at 9:56 a.m. |
|
Version 9.3 of newLISP has been released and has new functions to facilitate working with XML. newLISP has had the ability to parse XML data into an association list since version 6.10. 9.3 adds the ability to more easily traverse a parsed document and edit its contents. This article discusses the basics of parsing XML in newLISP as well has how to evaluate a parsed list back to XML.
newLISP 9.3 is arriving soon
posted on 01/31/08 at 4:33 p.m. |
|
With version 9.3 of newLISP on the cusp of release, I thought it apropos to discuss some of the improvements to the interpreter. While the buzz is all about FOOP (functional object-oriented programming), I am more interested in some of the new functions supporting nested association lists.
Concurrency in newLISP
posted on 09/18/07 at 9:25 a.m. |
|
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.
Faster string iteration using unpack
posted on 08/23/07 at 12:23 p.m. |
|
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.
Updating the newLISP MySQL5 module
posted on 08/01/07 at 3:55 p.m. |
|
Due to how busy things have been, I've nixed the newLisp C tutorial for the time being, and instead, have done some work on the newLisp MySQL5 module to update pieces that are broken and extend it with some nice, albeit basic, features.
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.
Nested contexts in newLISP
posted on 06/21/07 at 4:37 p.m. |
|
newLisp does not have nested contexts. This is because contexts are not OO-style objects, although they can be used to prototype other contexts. In fact, contexts are name spaces that can be manually created as needed. However, since they create efficient hashes that can be used for many of the same purposes as objects (such as data modeling), it would be handy if there were a way to create contexts inside of other contexts.
Validating parameter format
posted on 06/19/07 at 8:58 a.m. |
|
newLisp is a loosely-typed language. However, if you are developing a library or module that other projects may mix into their own code, it is useful to give helpful errors when a function receives incorrect input. Especially if your documentation is lax (which we know it never is), throwing usable errors when a function is misused will make the lives of developers using your code that much easier.
Simple error handling in newLISP
posted on 06/12/07 at 7:51 p.m. |
|
When I first began to program newLisp, I was concerned that it lacked the structured error handling syntax of the imperative languages I was used to. As my software begins to mature and I add more sophisticated error handling, I find that newLisp's simple functions result in cleaner, more expressive code.
Avoiding excess redundancy
posted on 06/08/07 at 8:11 a.m. |
|
There is an interesting article at Irrational Exuberance about anti-objects and reflective design. The author states, "The first - and only - programming paradigm I was taught at college was OO." Another recent blog post by a college CS tutor laments that object oriented design is the first (and often, the only) abstraction method taught to students in computer science programs.
Evolving lisp
posted on 06/07/07 at 8:58 p.m. |
|
Paul Graham notes that, "A popular recipe for new programming languages in the past 20 years has been to take the C model of computing and add to it, piecemeal, parts taken from the Lisp model, like runtime typing and garbage collection." This is what has made Python such a wonderful, elegant, and concise language. Why say with iteration what can be done in one easily readable line with a list comprehension?
Art is rough
posted on 06/01/07 at 4:57 p.m. |
|
Why's Poignant Guide claims that after learning Ruby you will write code so elegant it will make you cry. Paul Graham was not so dramatic, but he was closer to the mark. Lisp teaches you the elegance and grace of recursive and applicative programming. This creates beautiful and concise code.
newLISP in context
posted on 05/25/07 at 7:52 p.m. |
|
Have you ever had one of those moments where you suddenly just get it? It just happened to me with contexts in newLisp. Allow me to share my epiphany.
Macros
posted on 05/23/07 at 8:30 p.m. |
|
A common point of confusion for lisp beginners is the macro. Few lispers can resist the opportunity to expound the beauty and elegance of the macro. However, as with many lisp concepts, most explanations are outside the range of the hobbyist's experience.
Contextual programming
posted on 05/15/07 at 4:25 p.m. |
|
When working on a large project, it is usually advisable to break your code up into smaller portions. In many languages, these are called shared libraries: smaller chunks of code that can be reused as needed throughout this and other programs.
Lisp: where to start
posted on 05/13/07 at 1:06 p.m. |
|
When I first set out to learn lisp, I was faced with an intimidating number of choices. Which implementation of lisp should I choose? Common lisp? Scheme? I went with common lisp. Which common lisp? SBCL? MCL? Gnu clisp? Yeesh. This is enough to scare most lisp rookies off. Here is some advice: start off with Gnu clisp. It's available for most architectures, it's free, it has decent documentation online, and it's easy to install.