Download ALisp User`s Guide
Transcript
Introduction 1. Introduction ALisp is a small but scalable Lisp interpreter that has been developed with the aim of being embedded in other systems. It is therefore tightly interfaced with ANSII C and can share data structures and code with C. ALisp supports a subset of CommonLisp and conforms to the CommonLisp standard when possible. However, it is not a full CommonLisp implementation, but rather such constructs are not implemented that are felt not being critical and difficult to implement efficiently. These restrictions make ALisp relatively small and light-weight, which is important when embedding it in other systems. ALisp was designed to be embedded in the Amos II object-relational database kernel [2]. However, ALisp is a general system and can be used for many other applications as well. Since it is used in a database kernel it is very important that its storage manager is efficient and scales well. Thus all data structures are dynamic and can grow without performance degradation. The data structures grow gracefully so that there are never any significant delays for data reorganization, garbage collection, or data copying. (Except that the OS might sometimes do this, outside the control of ALisp). There are no limitations on how large the data area can grow, except OS address space limitations and the size of the virtual memory backing file. The performance is of course dependent on the size of the available main memory and thrashing may occur when the amount of memory used by ALisp is larger than the main memory. A critical component in a Lisp system is its garbage collector. Lisp programs often generate large amounts of temporary data areas that need to be reclaimed by garbage collection. Furthermore, since ALisp was designed to be used in a DBMS kernel it is essential that the garbage collection is predictable, i.e. it is not acceptable if the system would stop for garbage collection now and then. The garbage collector must therefore be incremental and continuously reclaim freed storage. Another requirement for ALisp is that it can share data structures with C, in order to be tightly embedded in other systems. Therefore, unlike many other implementations of Lisp (SmallTalk, Java, etc.) systems, both C and Lisp data structures are allocated in the same memory area and there is no need for expensive copying of large data areas between C and Lisp. This is essential for a predictable interface between C and Lisp, in particular if it is going to be used for managing large database objects as in ALisp’s main application. Section 2 describes the system functions in ALisp. The differences w.r.t. CommonLisp are documented. Section 3 gives an overview of the debugging facilities, while Section 4 describes the error handling mechanisms. Section 5 describes the I/O system and Section 6 overviews the storage manager interfaces. 2. Starting ALisp ALisp is a subsystem to Amos II [2]. Amos II is started with the OS command: amos2 There has to be a database file with a system Amos II database in the file: amos2.dmp in the same directory as where Amos II is started. When Amos II is started it accepts AMOSQL [2] commands from the console. To enter the ALisp read-eval-print top loop from the AMOSQL top loop, give the AMOSQL command: lisp; To go back to AMOSQL from ALisp mode, enter the keyword: :osql 2