next up previous contents index
Next: Alien Types Up: Alien Objects Previous: Alien Objects   Contents   Index

Introduction to Aliens

Because of Lisp's emphasis on dynamic memory allocation and garbage collection, Lisp implementations use unconventional memory representations for objects. This representation mismatch creates problems when a Lisp program must share objects with programs written in another language. There are three different approaches to establishing communication:

CMU Common Lisp relies primarily on the automatic conversion and direct manipulation approaches: Aliens of simple scalar types are automatically converted, while complex types are directly manipulated in their foreign representation. Any foreign objects that can't automatically be converted into Lisp values are represented by objects of typealien-value. Since Lisp is a dynamically typed language, even foreign objects must have a run-time type; this type information is provided by encapsulating the raw pointer to the foreign data within analien-value object.

The Alien type language and operations are most similar to those of the C language, but Aliens can also be used when communicating with most other languages that can be linked with C.


next up previous contents index
Next: Alien Types Up: Alien Objects Previous: Alien Objects   Contents   Index
Peter Van Eynde 2001-03-08