|
NLISP - A Numerical Common Lisp with Array SyntaxNLISP is an extension to Common Lisp that provides an interactive numerical computation environment, similar to packages like Matlab and IDL. NLISP has array syntax, scientific plotting and a numerical library. It runs under CMU Common Lisp. Sourceforge site: http://sourceforge.net/projects/nlisp. AbstractNumerical computer languages generally come in two flavours, traditional compiled languages like Fortran and C, or numerical packages like Matlab, IDL, Yorick and Octave. These packages borrow a great deal from lisp. An interactive environment, dynamic object (array) creation and garbage collection are features found in lisp systems. Common Lisp provides one of the best computing environments around, and is a far superior language to those found in numerical packages. It can also be compiled, like C or Fortran. As a numerical computation environment however, Lisp lacks three essential components. First, although Common Lisp has an array type, it does not have array syntax. Secondly, there is no in built support for producing scientific plots. And finally, lisp lacks an extensive library of mathematical functions, essential for a numerical computation environment. NLISP aims to add these three components to Common Lisp. Operators and functions for array syntax have been added in the form of 'dot operators' and 'dot functions' (not to be confused with the dot product!). For example '.+' is array plus and '.sin' is array sin. Plotting is provided through an interface to Gnuplot, and the GNU Scientific Library (GSL) provides the mathematical library.
Stage of DevelopmentNLISP is now on version 0.40, and is starting to become a useful and useable tool for numerical computation. The main component still missing is the complete GSL interface. At the moment, if you need a GSL library function you need to write a brief (few line) interface in lisp to access it (this is easy to do, and I give an example). The full interface will hopefully come in the next version. A big step forward in making Nlisp useable is the addition of an array indexing mechanism that comes with version 0.40. This offers a full and flexible syntax for array indexing. The plot shown above is generated by the short program shown below the plot. This demonstrates all three of the components that make up NLISP. It uses array syntax (.*, .+ and .sqrt), uses the Bessel_J0 function from GSL and, of course, produces a nice plot. Have a look at the examples to see what it can already do. There are two simple plotting examples, an example that shows how to interface to GSL (it performs and plots the results of an FFT). And finally, to show that NLISP is already suitable for writing slightly larger programs, there is a simple simulator for an airborne pulse-limited radar altimeter, that calculates the expected received echo power as a function of time. WarrantyNLISP comes with absolutely no waranty whatsoever. NOTE: NLISP is a private project by the author. It has no connection to University College London, CPOM or the Department of Space and Climate Physics. |