Paradigms | Multi-paradigm: functional, procedural, object-oriented, reflective, meta |
---|---|
Family | Lisp |
Designed by | Christian Jullien |
Developer | Christian Jullien |
First appeared | April 1988 |
Stable release | 11.7.0 / 13 December 2022 |
Typing discipline | Dynamic, strong |
Implementation language | C, OpenLisp |
Platform | x86, x86-64, IA-64, SPARC, PowerPC, MIPS, Alpha, PA-RISC, ARM, AArch64, RISC-V, Loongson |
OS | Windows, most Unix-based, Linux, macOS, FreeBSD, OpenBSD, NetBSD, Solaris, HP-UX, AIX, QNX, DOS, OS/2, Pocket PC, OpenVMS, z/OS, Cygwin |
License | Proprietary |
Website | www |
Influenced by | |
Lisp, ISLISP |
OpenLisp is a programming language in the Lisp family developed by Christian Jullien [1] from Eligis. It conforms [2] [3] [4] to the international standard for ISLISP published jointly by the International Organization for Standardization (ISO) and International Electrotechnical Commission (IEC), ISO/IEC 13816:1997(E), [5] [6] revised to ISO/IEC 13816:2007(E). [7]
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 (hashtable, readtable, package, defstruct, sequences, rational numbers) and other libraries (network socket, regular expression, XML, Portable Operating System Interface (POSIX), SQL, Lightweight Directory Access Protocol (LDAP)). [8]
OpenLisp includes an interpreter associated to a read–eval–print loop (REPL), a Lisp Assembly Program (LAP) and a backend compiler for the language C.
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 (via Java Native Interface (JNI)). 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.
Despite its name, OpenLisp is proprietary software. Its interpreter is available free of charge for any noncommercial use.
OpenLisp mainly runs in console mode: cmd.exe
on Microsoft Windows, and terminal emulator on Unix-based systems.
;; OpenLisp v11.x.y (Build: XXXX) by C. Jullien [Jan 01 20xx - 10:49:13];; Copyright (c) Eligis - 1988-20xx.;; System 'sysname' (64-bit, 8 CPU) on 'hostname', ASCII.;; God thank you, OpenLisp is back again!?(fib20);; elapsed time = 0.003s, (0 gc).=6765?_
Alternate solutions include running OpenLisp from Emacs via setting up Emacs inferior-lisp-mode
, or using an integrated development environment (IDE) which supports OpenLisp syntax. LispIDE by DaanSystems does so natively.
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 garbage collection is a mark and sweep with coalescing heap (sweep phase can be configured to use threads).
OpenLisp uses tagged architecture (4 bits tag on 32-bit, 5 bits tag on 64-bit) for fast type checking (small integer, float, symbol, cons, string, vector). Small integers (28 bits on 32-bit, 59 bits on 64-bit) are unboxed, large (32/64-bit) integers are boxed. As required by ISLISP, arbitrary-precision arithmetic (bignums) are also implemented. Characters (hence strings) are either 8-bit (ANSI, EBCDIC) or 16/32-bit if Unicode support is enabled.
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.
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.
Year | Version | Main feature |
---|---|---|
1988 | 1.0 | OpenLisp begun as a toy language named MLisp (Minimal Lisp) to experiment with ideas from ISLISP standards process |
1993 | 3.3 | First port on 64-bit machine (DEC Alpha OSF/1); name change from MLisp to OpenLisp |
1994 | 4.0 | First commercial use |
1995 | 4.5 | Socket streams support |
1997 | 5.7 | OpenLisp is first Lisp to implement ISLISP ISO/IEC 13816:1997(E) standard. [10] |
1998 | 5.8 | Unicode optional support |
2000 | 6.6 | Lisp to LAP compiler; LAP is interpreted by a virtual machine embedded in OpenLisp; speed improved about 2x |
2003 | 7.5 | Lisp to C backend; able to compile an application with many Lisp files to a standalone executable; speed improved from 10x to 20x |
2007 | 8.7 | Changes to match ISO/IEC 13816:2007(E) revision [7] |
2010 | 9.2 | Native integer arbitrary-precision arithmetic support |
2021 | 11.2 | Added complete CLtL format extension; improve heap detection |
2022 | 11.4 | Rework of activation blocks makes interpreter around 15% faster. Experimental ASDF clone. |
2022 | 11.5 | Generic function calls are ~3x faster. Improved regex internal module. |
2022 | 11.6 | Add <simple-bit-vector> type and related BIT functions similar to CLtL equivalent. |
2022 | 11.7 | Current version |
1958 | 1960 | 1965 | 1970 | 1975 | 1980 | 1985 | 1990 | 1995 | 2000 | 2005 | 2010 | 2015 | 2020 | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LISP 1, 1.5, LISP 2(abandoned) | |||||||||||||||
Maclisp | |||||||||||||||
Interlisp | |||||||||||||||
MDL | |||||||||||||||
Lisp Machine Lisp | |||||||||||||||
Scheme | R5RS | R6RS | R7RS small | ||||||||||||
NIL | |||||||||||||||
ZIL (Zork Implementation Language) | |||||||||||||||
Franz Lisp | |||||||||||||||
Common Lisp | ANSI standard | ||||||||||||||
Le Lisp | |||||||||||||||
MIT Scheme | |||||||||||||||
XLISP | |||||||||||||||
T | |||||||||||||||
Chez Scheme | |||||||||||||||
Emacs Lisp | |||||||||||||||
AutoLISP | |||||||||||||||
PicoLisp | |||||||||||||||
Gambit | |||||||||||||||
EuLisp | |||||||||||||||
ISLISP | |||||||||||||||
OpenLisp | |||||||||||||||
PLT Scheme | Racket | ||||||||||||||
newLISP | |||||||||||||||
GNU Guile | |||||||||||||||
Visual LISP | |||||||||||||||
Clojure | |||||||||||||||
Arc | |||||||||||||||
LFE | |||||||||||||||
Hy | |||||||||||||||
Chialisp |
OpenLisp claims to be extremely portable, it runs on many operating systems including: Windows, most Unix and POSIX based (Linux, macOS, FreeBSD, OpenBSD, NetBSD, Solaris, HP-UX, AIX, Cygwin, QNX), DOS, OS/2, Pocket PC, OpenVMS, z/OS. The official website download section contains over 50 different versions.
OpenLisp can interact with modules written in C using foreign function interface (FFI), ISLISP streams are extended to support network socket (./net
directory includes samples for Hypertext Transfer Protocol (http), JavaScript Object Notation (JSON), Post Office Protocol 3 (POP3), Simple Mail Transfer Protocol (SMTP), Telnet, Rss), a simplified Extensible Markup Language (XML) reader can convert XML to Lisp. A basic SQL module can be used with MySQL, Odbc, SQLite, PostgreSQL. A comma-separated values (CSV) module can read and write CSV files.
Developer tools include data logging, pretty-printer, profiler, design by contract programming, and unit tests.
Some well known algorithms are available in ./contrib
directory (Dantzig's simplex algorithm, Dijkstra's algorithm, Ford–Fulkerson algorithm). Modules are shipped using BSD licenses.
The prefix Open refers to open systems not to the open-source model. [11]
The name was chosen in 1993 to replace the MLisp internal code name which was already used by Gosling Emacs (as successor of Mocklisp).
OpenLisp programming language is different than OpenLISP, a project begun in 1997 to implement Locator/Identifier Separation Protocol.
This section describes how a compiler transforms Lisp code to C.
The Fibonacci number function (this classic definition used in most benchmarks is not the most efficient way to compute fib
)
(defunfib(n)(cond((eqn1)1)((eqn2)1)(t(+(fib(-n1))(fib(-n2))))))
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:
((fentryfib100)(param0)(jeq_l004'1)(jneq_l003'2)(movea1'1)(return)_l003(gsub1a1)(recurse1)(movea2a1)(param0)(gsuba1'2)(recurse1)(gadda2a1)_l004(return)(end))
Finally, C code generator uses LAP code to translate instructions in C.
staticPOINTEROLDEFCOMPILED1(olfib_00,p1){POINTERa1;POINTERVOLATILEa2;ollapenter(SN_OLFIB_00);a1=p1;if(eq(a1,olmakefix(1)))goto_l004;if(!eq(a1,olmakefix(2)))goto_l003;ollapleave(SN_OLFIB_00);returnolmakefix(1);_l003:a1=ollapgsub(a1,olmakefix(1));a2=olfib_00(a1);a1=ollapgsub(p1,olmakefix(2));a1=olfib_00(a1);a1=ollapgadd(a2,a1);_l004:ollapleave(SN_OLFIB_00);returna1;}
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.
It has been chosen by SDF Public Access Unix System nonprofit public access Unix systems on the Internet [12] [13] as one of its programming languages available online.
Bricsys uses OpenLisp to implement AutoLISP in its Bricscad computer-aided design (CAD) system. [14]
MEVA [15] is entirely written with OpenLisp.
Università degli Studi di Palermo uses OpenLisp to teach Lisp. [16]
C is a general-purpose computer programming language. It was created in the 1970s by Dennis Ritchie, and remains very widely used and influential. By design, C's features cleanly reflect the capabilities of the targeted CPUs. It has found lasting use in operating systems, device drivers, and protocol stacks, but its use in application software has been decreasing. C is commonly used on computer architectures that range from the largest supercomputers to the smallest microcontrollers and embedded systems.
Common Lisp (CL) is a dialect of the Lisp programming language, published in American National Standards Institute (ANSI) standard document ANSI INCITS 226-1994 (S2018). The Common Lisp HyperSpec, a hyperlinked HTML version, has been derived from the ANSI Common Lisp standard.
Emacs Lisp is a dialect of the Lisp programming language used as a scripting language by Emacs. It is used for implementing most of the editing functionality built into Emacs, the remainder being written in C, as is the Lisp interpreter. Emacs Lisp is also termed Elisp, although there are also older, unrelated Lisp dialects with that name.
An integrated development environment (IDE) is a software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, and a debugger. Some IDEs, such as IntelliJ IDEA, Eclipse and Lazarus contain the necessary compiler, interpreter or both; others, such as SharpDevelop and NetBeans, do not.
Lisp is a family of programming languages with a long history and a distinctive, fully parenthesized prefix notation. Originally specified in 1960, Lisp is the third-oldest high-level programming language still in common use, after Fortran and COBOL. Lisp has changed since its early days, and many dialects have existed over its history. Today, the best-known general-purpose Lisp dialects are Common Lisp, Scheme, Racket, and Clojure.
The C standard library or libc is the standard library for the C programming language, as specified in the ISO C standard. Starting from the original ANSI C standard, it was developed at the same time as the C library POSIX specification, which is a superset of it. Since ANSI C was adopted by the International Organization for Standardization, the C standard library is also called the ISO C library.
In computing, a locale is a set of parameters that defines the user's language, region and any special variant preferences that the user wants to see in their user interface. Usually a locale identifier consists of at least a language code and a country/region code. Locale is an important aspect of i18n.
CMUCL is a free Common Lisp implementation, originally developed at Carnegie Mellon University.
In computer programming, Franz Lisp is a discontinued Lisp programming language system written at the University of California, Berkeley by Professor Richard Fateman and several students, based largely on Maclisp and distributed with the Berkeley Software Distribution (BSD) for the Digital Equipment Corporation (DEC) VAX minicomputer. Piggybacking on the popularity of the BSD package, Franz Lisp was probably the most widely distributed and used Lisp system of the 1970s and 1980s.
ISO/IEC 10967, Language independent arithmetic (LIA), is a series of standards on computer arithmetic. It is compatible with ISO/IEC/IEEE 60559:2011, more known as IEEE 754-2008, and much of the specifications are for IEEE 754 special values (though such values are not required by LIA itself, unless the parameter iec559 is true). It was developed by the working group ISO/IEC JTC1/SC22/WG11, which was disbanded in 2011.
In programming and software design, binding is an application programming interface (API) that provides glue code specifically made to allow a programming language to use a foreign library or operating system service.
Programming languages are used for controlling the behavior of a machine. Like natural languages, programming languages follow rules for syntax and semantics.
ISLISP is a programming language in the Lisp family standardized by the International Organization for Standardization (ISO) and International Electrotechnical Commission (IEC) joint working group ISO/IEC JTC 1/SC 22/WG 16. The primary output of this working group was an international standard, published by ISO. The standard was updated in 2007 and republished as ISO/IEC 13816:2007(E). Although official publication was through ISO, versions of the ISLISP language specification are available that are believed to be in the public domain.
C alternative tokens refer to a set of alternative spellings of common operators in the C programming language. They are implemented as a group of macro constants in the C standard library in the iso646.h
header. The tokens were created by Bjarne Stroustrup for the pre-standard C++ language and were added to the C standard in a 1995 amendment to the C90 standard via library to avoid the breakage of existing code.
In the C++ programming language, decltype
is a keyword used to query the type of an expression. Introduced in C++11, its primary intended use is in generic programming, where it is often difficult, or even impossible, to express types that depend on template parameters.
In computer programming, self-hosting is the use of a program as part of the toolchain or operating system that produces new versions of that same program—for example, a compiler that can compile its own source code. Self-hosting software is commonplace on personal computers and larger systems. Other programs that are typically self-hosting include kernels, assemblers, command-line interpreters and revision control software.
{{cite journal}}
: CS1 maint: multiple names: authors list (link){{cite web}}
: CS1 maint: numeric names: authors list (link)