newLISP

From Wikipedia, the free encyclopedia

newLISP
Paradigm Multi-paradigm
Appeared in 1991
Designed by Lutz Mueller
Developer Lutz Mueller of Nuevatec
Latest release 9.3/ February 1, 2008
OS Cross-platform
License GNU General Public License
Website www.newlisp.org

newLISP is an open source scripting language in the Lisp family of programming languages developed by Lutz Mueller and released under the GNU General Public License.

Contents

[edit] History

newLISP has its origin back in 1991 and was originally developed on a Sun4 workstation, then moved to Windows 3.0, where version 1.3 was released on CompuServe around 1993. newLISP was then available as a Windows GUI graphics capable application and a DOS console application (both 16bit). In 1995, with the release of Windows 95, newLISP moved to 32-bit.

In April 1999, newLISP was ported to Linux, some of the core algorithms were rewritten, and all Windows-specific code eliminated. In 1999, newLISP was released as an Open Source project, licensed under the GPL, and development stopped on Windows after version 6.0.25. During the first half of 2001 newLISP was ported back to Windows again on to the Cygwin platform and without graphics capabilities. A multi platform Tcl/Tk frontend named newLISP-tk was released around version 6.3.0, during the second half of 2001. 64-bit precision was introduced for integer arithmetic and for some operations on files in version 9.0 in 2006.

Since the release of 6.5 in mid 2002 development has been very active: many new features have been added, and a community of users has grown.

Since 2003, four or more major versions have been released each year. The current version 9.3 was released in February 2008.

[edit] Philosophy

The aim of newLISP is to provide a fast, powerful, cross-platform, full-featured scripting version of the Lisp programming language which uses only a modest amount of system resources such as disk space and memory.

newLISP runs on the BSDs, GNU/Linux, Mac OS X, Solaris, and Windows operating systems.

newLISP provides essential Lisp features such as lists, functions, symbol processing, recursion, function mapping, anonymous functions (lambda expressions), s-expressions (excluding improper lists), and macros.

newLISP also aims to provide[clarify] all the library functions expected of a modern scripting language, including support for regular expressions, XML, Unicode (UTF-8), TCP/IP and UDP networking, matrix and array processing, advanced math, statistics and Bayesian statistical analysis, financial mathematics, and distributed computing support.

The newLISP installation provides support for MYSQL, SQLite and ODBC database access, CGI, SMTP, POP3, FTP and XML-RPC. newLISP can also run as a daemon (server mode).

newLISP aims for conservative memory requirements: on Linux a newLISP process uses about 600KB of memory. The binary executable file occupies about 200KB of disk space on Linux.

With this combination of extensive built-in libraries and its modest use of resources, newLISP is suitable for quick prototyping, system customization, server-side CGI scripting, and for use as an embedded scripting language.

The language aims to provide a simple, consistent, streamlined, Lisp environment that minimizes the learning curve and maximizes programmer productivity and pleasure.

For more information, refer to the newLISP FAQ and the newLISP documentation referenced below.

[edit] The language

[edit] Contexts

newLISP supports namespaces called contexts. They can be assigned to variables and passed to functions, but they are associated with globally unique symbols, which limits their usage as first-class objects. A prototype-based OO style of programming is possible in newLISP, using contexts as prototypes for construction of objects. Variables inside contexts do not interfere with variables of the same name in other contexts, but inside a context variables behave according to the rules of dynamic scoping.

[edit] Scoping

newLISP uses dynamic scoping. Which means, when a function is called, it can see all variables of its caller and its caller's caller, and so on, within the same context or name space. Parameter variables of the called function will shadow (overwrite) the callers variable environment, but revert to previous bindings of the caller upon return of the function. To make sure your non parameter variables are not bound in the caller's environment, you have to create a new context. So, there are only locally isolated variables in contexts and temporary bindings of parameter variables during function execution.

To keep things in order, the general rule is to create groups of closely related functions within separate contexts, which play the role of namespaces or classes.

[edit] Memory management

newLISP uses a method of automatic memory management different from traditional garbage collection schemes called "One Reference Only (ORO) Memory Management" (see Automatic Memory Management in newLISP).

Each variable is referenced only by its context, and each context is referenced globally.

newLISP does not support sharing of subobjects among objects, cyclic structures, nor multiple variables pointing to the same object. Objects are (physically) copied when stored in data structures or passed to functions, except passing to particular builtin functions. The exceptions are symbols and contexts, which are not implicitly copied but shared, and thus they can be used for indirection. Symbols and contexts are globally named and are deleted explicitly; deleting a symbol or context scans all other objects to replace references to it with nil.

[edit] GUI options

The Tcl/Tk version of newLISP provides a graphical interface, using Tcl/Tk. So if using newLISP for GUI programming, a working knowledge of Tk is assumed. It can also work with the GTK server.

[edit] Stand-alone binaries

It is possible to construct executable files for deployment using any version of newLISP. These files are self-contained and require no installation.

[edit] External links