Rahul Sharma (Editor)

OpenLisp

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Original author(s)
  
Christian Jullien

Written in
  
C and OpenLisp

OpenLisp

Initial release
  
April 1988; 28 years ago (1988-04)

Stable release
  
10.3.0 / March 5, 2017; 20 days ago (2017-03-05)

Operating system
  
Windows, Linux, MacOS, Solaris, HP-UX, AIX, OpenBSD, FreeBSD, NetBSD, PocketPC, QNX, VMS, Z/OS, Cygwin

Platform
  
x86, x86_64, ia64, sparc, sparcv9, PowerPC, mips, alpha, parisc, ARM, AArch64

OpenLisp is a programming language in the LISP family developed by Christian Jullien. It conforms to ISLISP International Standard, ISO/IEC 13816:1997(E) revised by ISO/IEC 13816:2007(E), published by ISO.

Contents

Written in C and Lisp, it runs on most common operating systems. OpenLisp is designated an ISLISP implementation, but also contains many Common Lisp-compatible extensions (hashtable, readtable, package, defstruct, sequences, rational numbers) as well as other libraries (network socket, regular expression, XML, Posix, SQL, LDAP).

OpenLisp includes an interpreter associated to a REPL, a Lisp Assembly Program (LAP) and a C backend compiler.

Goals

The main goal of this Lisp version is to implement a fully compliant ISLISP system (when launched with -islisp flag, it is strictly restricted to ISO/IEC 13816:2007(E) specification). The secondary goal is to provide a complete embeddable Lisp system linkable to C/C++ or Java (with help of JNI). A callback mechanism is used to communicate with the external program. Other goals are to be usable as script language or glue language and to produce standalone executables

License

Despite its name, OpenLisp is proprietary software. Its interpreter is available free of charge for any non-commercial usage.

User interface

OpenLisp mainly runs in console mode (Cmd on Microsoft Windows, Terminal emulator on Unix-based systems).

An alternate solution is to set up Emacs inferior-lisp-mode to run OpenLisp from Emacs. DaanSystems LispIDE has native support for OpenLisp syntax.

Memory manager

Internally, OpenLisp uses virtual memory to allocate and extend objects automatically. Small objects of the same type are allocated using a Bibop (BIg Bag Of Pages) memory organization. Large objects use a proxy which point to the real object in Lisp heap. The conservative GC is a "mark and sweep" with coalescing heap (sweep phase can be configured to use threads).

Data types

OpenLisp uses tagged architecture (4 bits tag on 32bit, 5 bits tag on 64bit) for fast type checking (small integer, float, symbol, cons, string, vector). Small integers (28 bits on 32bit, 59 bits on 64bit) are unboxed, large (32bit/64bit) integers are boxed. As required by ISLISP, bignums are also implemented. Characters (hence strings) are either 8bit (ANSI, EBCDIC) or 16/32bit if Unicode support is enabled.

Evaluator and compiler

The Lisp Kernel, native interpreter and basic libraries are hand coded in C, LAP intermediate language produced by the compiler is then translated to C by the C backend code generator.

History

* In 1988 the very first intention was to implement a LISP subset to extend EmACT, an Emacs clone. ISLISP quickly became an obvious choice.

Ports

OpenLisp claims to be extremely portable, it runs on numerous operating systems: Microsoft Windows, most Unix-based, QNX, MS-DOS, OS/2, Pocket PC, OpenVMS, and z/OS. The official website download section contains more than 50 different versions.

Connectors

OpenLisp can interact with modules written in C using FFI, ISLISP streams are extended to support Network socket (./net directory includes samples for Http, Json, Pop3, Smtp, Telnet, Rss), a simplified XML reader can convert XML to Lisp. A basic SQL module can be used with MySQL, Odbc, SQLite, PostgreSQL. A CSV module can read and write CSV files.

Tools

Developer tools include data logging, pretty-printer, profiler, contract programming, and unit tests.

Algorithms

Some well known algorithms are available in ./contrib directory (simplex algorithm, Dijkstra's algorithm, Ford Fulkerson). Modules are shipped using BSD license.

Origin of name

The prefix Open refers to open system not to open source.

The name was chosen in 1993 to replace MLisp internal code name which was already used by Gosling Emacs (as successor of Mocklisp).

OpenLisp computer language should not be confused with OpenLISP, a project started in 1997 to implement Locator/ID Separation Protocol.

Compiler

This section describes how compiler transforms Lisp code to C.

Source code

The Fibonacci function (this classic definition used in most benchmarks is not the most efficient way to compute fib)

LAP intermediate code

Lisp compiler translates Lisp source code to the following intermediate code. It is followed by a peephole optimization pass that uses this intermediate format to analyze and optimize instructions. After optimization, final LAP code is:

C code translation

Finally, C code generator uses LAP code to translate instructions in C.

Adoption

It has been chosen by SDF Public Access Unix System nonprofit public access UNIX systems on the Internet as one of its programming languages available online.

Bricsys uses OpenLisp to implement AutoLISP in its Bricscad CAD system.

MEVA is entirely written with OpenLisp.

Università Degli Studi Di Palermo uses OpenLisp to teach Lisp.

References

OpenLisp Wikipedia