OpenLisp


OpenLisp is a programming language in the Lisp family developed by Christian Jullien from Eligis. It conforms to the international standard for ISLISP published jointly by the International Organization for Standardization and International Electrotechnical Commission, ISO/IEC 13816:1997, revised to ISO/IEC 13816:2007.
Written in the programming languages C and Lisp, it runs on most common operating systems. OpenLisp is designated an ISLISP implementation, but also contains many Common Lisp-compatible extensions and other libraries, SQL, Lightweight Directory Access Protocol ).
OpenLisp includes an interpreter associated to a read–eval–print loop, a Lisp Assembly Program and a backend compiler for the language C.

Goals

The main goal of this Lisp version is to implement a fully compliant ISLISP system. The secondary goal is to provide a complete embeddable Lisp system linkable to C/C++ or Java. A callback mechanism is used to communicate with the external program. Other goals are to be usable as scripting language or glue language and to produce standalone program executables.

License

Despite its name, OpenLisp is proprietary software. Its interpreter is available free of charge for any noncommercial use.

User interface

OpenLisp mainly runs in console mode: cmd.exe on Microsoft Windows, and terminal emulator on Unix-based systems.

;; OpenLisp v11.x.y by C. Jullien
;; Copyright Eligis - 1988-20xx.
;; System 'sysname' on 'hostname', ASCII.
;; God thank you, OpenLisp is back again!
?
;; elapsed time = 0.003s,.
= 6765
? _

Alternate solutions include running OpenLisp from Emacs via setting up Emacs inferior-lisp-mode, or using an integrated development environment which supports OpenLisp syntax. LispIDE by DaanSystems does so natively.

Technology

Memory manager

Internally, OpenLisp uses virtual memory to allocate and extend objects automatically. Small objects of the same type are allocated using a Bibop memory organization. Large objects use a proxy which point to the real object in Lisp heap. The conservative garbage collection is a mark and sweep with coalescing heap.

Data types

OpenLisp uses tagged architecture for fast type checking. Small integers are unboxed, large integers are boxed. As required by ISLISP, arbitrary-precision arithmetic are also implemented. Characters are either 8-bit or 16/32-bit if Unicode support is enabled.

Evaluator and compiler

The Lisp Kernel, native interpreter and basic libraries are hand coded in the language 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 motive behind OpenLisp was to implement a Lisp subset to extend EmACT, an Emacs clone. ISLISP became an obvious choice quickly. Further development ensued.
YearVersionMain feature
19881.0OpenLisp begun as a toy language named MLisp to experiment with ideas from ISLISP standards process
19933.3First port on 64-bit machine ; name change from MLisp to OpenLisp
19944.0First commercial use
19954.5Socket streams support
19975.7OpenLisp is first Lisp to implement ISLISP ISO/IEC 13816:1997 standard.
19985.8Unicode optional support
20006.6Lisp to LAP compiler; LAP is interpreted by a virtual machine embedded in OpenLisp; speed improved about 2x
20037.5Lisp to C backend; able to compile an application with many Lisp files to a standalone executable; speed improved from 10x to 20x
20078.7Changes to match ISO/IEC 13816:2007 revision
20109.2Native integer arbitrary-precision arithmetic support
202111.2Added complete CLtL format extension; improve heap detection
202211.4Rework of activation blocks makes interpreter around 15% faster. Experimental ASDF clone.
202211.5Generic function calls are ~3x faster. Improved regex internal module.
202211.6Add type and related BIT functions similar to CLtL equivalent.
202211.7Current version

Ports

OpenLisp claims to be extremely portable, it runs on many operating systems including: Windows, most Unix and POSIX based, DOS, OS/2, Pocket PC, OpenVMS, z/OS. The official website download section contains over 50 different versions.

Standard libraries

Connectors

OpenLisp can interact with modules written in C using foreign function interface, ISLISP streams are extended to support network socket, JavaScript Object Notation, Post Office Protocol 3, Simple Mail Transfer Protocol, a simplified Extensible Markup Language reader can convert XML to Lisp. A basic SQL module can be used with MySQL, Odbc, SQLite, PostgreSQL. A comma-separated values module can read and write CSV files.

Tools

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

Algorithms

Some well known algorithms are available in ./contrib directory. Modules are shipped using BSD licenses.

Origin of [|name]

The prefix Open refers to open systems not to the open-source model.
The name was chosen in 1993 to replace the MLisp internal code name which was already used by Gosling Emacs.
OpenLisp programming language is different than OpenLISP, a project begun in 1997 to implement Locator/Identifier Separation Protocol.

Compiler

This section describes how a compiler transforms Lisp code to C.

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:







_l003







_l004

)

C code translation

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

static POINTER
OLDEFCOMPILED1

Style guide

Line length

OpenLisp accepts lines having unlimited length. The recommended style is that each line of text in code should have at most 80 characters per line.

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 computer-aided design system.
MEVA is entirely written with OpenLisp.
Università degli Studi di Palermo uses OpenLisp to teach Lisp.