In-reply-to: ···@planetx.bloomu.edu's message of 25 Apr 1995 16:08:04 GMT
Newsgroups: comp.lang.lisp
Subject: Re: What is LISP mostly used for ?
References: <····················@luo.bloomu.edu>
In article <····················@luo.bloomu.edu> ···@planetx.bloomu.edu (J.Luo) writes:
>
> I guess I am asking a very shallow question: What are LISP's strengths
> and weaknesses? In where do people normally use LISP?
>
These days, in locked rooms where no one can find out what they are doing.
Just kidding. I'll try to give a rough cut at this and others can correct
my mistakes. Also, if this is a question for some course you are taking
I've encoded the answers so that your professor will know.
- First and foremost, Lisp is the language of choice for Artificial
Intelligence research and applications. There are several of Lisp's
strengths that are the reason for this, here are some important ones:
1. Automatic storage allocation and list processing. In many reasoning
based algorithms there appears a lot of throw away structure. It's akin to
how a human uses a scratch pad or white board as an aid to thinking. A
solid and portable list processing library is fundamental in modeling this
structure as lists, stacks, queues, trees, graphs etc. In particular
recursive data structure occurs frequently in Artificial Intelligence
algorithms and Lisp is very good at handling that. In conjunction with this
throw away structure, automatic storage allocation is of great help and
assures a degree of safety. It is found that trying to do complex
algorithms with lots of this kind of dynamic structure, in a language such a
C++ (without using auto-allocation) for example, results in uncontrollable
memory leaks causing the program to break at unpredictable times. On the
other hand automatic storage allocation, usually handled by algorithms
called Garbage Collectors, results in a pause when nothing can happen until
the garbage is collected. Fortunately modern garbage collector algorithms
are making the pause briefer and briefer.
2. Dynamic typing and Lisp interpreter. Lisp can be compiled or interpreted
and all objects have a dynamic type. There are many derived benefits from
these two strengths. Two important ones are the notion of exploratory
programming and rapid prototyping. Because a Lisp system is not burdened by
having to maintain a statically typed set of program files and all of the
implied dependencies, small pieces of code can be experimented with inside
of a larger body of compiled code. Ideas can be rapidly developed without
having to suffer the long compile cycle. Furthermore, because the system
knows dynamically about its object types, the visibility of the run time
program is greatly enhanced, and consequently very elaborate debugging
strategies are possible, resulting in faster debugging. Another strength of
dynamic typing is that the object hierarchy flexibility is greatly enhanced
in terms of dynamic dispatching. Contrast for example Object-C's dynamic
binding to C++'s very static virtual function dispatch. A weakness here for
Lisp is that dynamic type dispatching is generally slower than static type
dispatching. Once again modern compiler technology and new Lisp
architectures helps Lisp programs compile more efficiently.
3. Symbolic processing. Symbols are an integral part of Lisp's
architecture. Types are named by symbols. Symbols are not strings but
objects themselves. And Lisp programs are written using the same symbol
system that the program algorithm uses for attributes. A re-occuring method
of Artificial Intelligence is that of abstraction and symbols are used to
represent abstractions as a very efficient and fast tag to pass around from
program to program and in object slots. Also since Lisp programs are
nothing more than lists of these symbols called symbolic expressions it is
very easy to parse such lists in Lisp. In fact many Artificial Intelligence
related C programs use Lisp lists as external data representations.
4. Functional programming. Lisp encourages a functional programming style
and it is possible to program in Lisp in a pure functional programming
style. By using this pure style, side effects like the assignment of global
variables can be eliminated. This is important for parallel or reentrant
program threads where one thread's side effect would affect another.
5. Reflexive programming. Because of symbolic expressions mentioned above
and that in Lisp, functions are first class objects, Lisp programs can refer
to and modify themselves dynamically. This is important in Artificial
Intelligence areas of automatic program generators and program analysis.
The problem of efficiency here for Lisp is not so bad because the
dynamically generated symbolic expressions can also be compiled dynamically.
6. Elegance. Lisp is considered by many as the most elegant applied
programming language extant. Elegance means that the Lisp architecture is
defined as mathematically pure and simple as possible. Lisp's control
structure is roughly based on the Lambda Calculus. In recent years, with
the ballyhoo of program efficiency and statically typed languages, elegance
has been put down as a more or less weakness of Lisp because of the
inefficiencies that it seems to imply. However this ballyhoo has not made
the importance of elegance go away. For the Artificial Intelligence
programmer involved with complex programs elegance is very important.
Elegance makes it easier for a programmer to predict how his complex program
will behave.
- Lisp is used as an extension language for Emacs. To the first time user
Emacs appears to be another editor. But in fact it has evolved into a sort
of virtual extensible operating system. For example when using Emacs under
Unix one rarely has to use the Unix paradigm for getting work done. The
power of Emacs is that it is built up out of Lisp primitives and is
extensible using those primitives. With all of the advantages of Lisp
mentioned above Emacs now becomes an essential tool for all sorts of
automations for your daily work on a computer. In fact some people doing
Automated Programming research believe that the problem solution is some
sort of super Emacs environment. Once again the down side of Emacs being
mostly written in Lisp is that of efficiency of Emacs Lisp programs and the
Garbage Collector pause. However very few Emacs users seem to even consider
this a problem.
- Lisp lends itself to being a machine language. Because of the elegance
mentioned above Lisp was one of the few high level languages chosen as a
model for a computer's control unit. This was also true for parallel
computers. Because of the ballyhoo mentioned above Lisp lost some of its
mass appeal and these Lisp machines became extinct. Some people believe that
after the ballyhoo dies down Lisp will be rediscovered and new Lisp
architectures will become popular again.
- Lisp is used as a vehicle for embedded languages. Because of Lisp's
powerful macro facility new syntax for new embedded languages are common.
For example early Prologs were embedded in Lisp. Another example is music
composition languages embedded in Lisp.
- Lisp is used in CAD work. See for example AutoLisp and AutoCAD. I don't
know much about this, perhaps someone else could comment.
- Lisp is used in games programming technology. Again, I don't know much
about this perhaps some one else could comment.
--
William P. Vrotney - ·······@netcom.com
William> - Lisp is used in CAD work. See for example AutoLisp and
William> AutoCAD. I don't know much about this, perhaps someone else
William> could comment.
AutoLisp was derived from David Betz' XLisp interpreter, by removing
almost everything that isn't absolutely necessary, and probably quite
a bit that one would normally consider absolutely necessary, such as
LET (you can still use LAMBDA though). Guess that was necessary to
have AutoCAD run well under the memory restrictions at the time.
Most AutoLisp packages I saw looked a lot like FORTRAN code with
parentheses. I guess most developers of AutoCAD-based applications
were happy when a C API for AutoCAD came out (called ADE I think).
I don't know whether they have improved AutoLisp over the last couple
of years, or whether everybody is using ADE by now. Probably the
latter. Anyway, I would not cite AutoLisp as a "success story" of
Lisp in the commercial world. I guess they simply chose Lisp because
XLisp was available, small and versatile, not because Lisp is elegant
or because they wanted people to develop AI applications with AutoCAD.
--
Simon.
Simon Leinen (·····@lia.di.epfl.ch) wrote:
> AutoLisp was derived from David Betz' XLisp interpreter, by removing
> almost everything that isn't absolutely necessary, and probably quite
> a bit that one would normally consider absolutely necessary, such as
> LET (you can still use LAMBDA though). Guess that was necessary to
> have AutoCAD run well under the memory restrictions at the time.
It was the XLISP 1.5, and they ripped of classes, macros (for what I hate
them, cause this needs no memory), and lot of more useful stuff (do, let,
prog, fast destructive list functions)
> Most AutoLisp packages I saw looked a lot like FORTRAN code with
> parentheses. I guess most developers of AutoCAD-based applications
> were happy when a C API for AutoCAD came out (called ADE I think).
It's called ADS (Axxxdesk Development System), and is on top of Lisp, that
means you can only call C functions via (c:...)! And most AutoCAD
programmers, as me, are not happy with the C API, cause Lisp is a bit more
elegant and interactive. Points are lists of 2-3 reals, polylines or faces
are just lists of points and you can do a lot of computional geometry
with AutoLisp, at least more reasonable than to start a C debugging session.
With Lisp you solve a relative simple day-by-day problem in 1 hour, in C you
need at least 1 day, but the code runs 20 seconds faster. Whow!
> I don't know whether they have improved AutoLisp over the last couple
> of years, or whether everybody is using ADE by now. Probably the
> latter. Anyway, I would not cite AutoLisp as a "success story" of
> Lisp in the commercial world. I guess they simply chose Lisp because
> XLisp was available, small and versatile, not because Lisp is elegant
> or because they wanted people to develop AI applications with AutoCAD.
Well this is the problem. They got so big partially because of the easy Lisp
interface and customization possibilities. There're thousands of simple Lisp
solutions around. Lisp was a success, because a lot of people who would have
learned Pascal or C like languages now program in Lisp, even if it's a very
pure Lisp. AutoDesk now wants to drop it, in one or two years maybe.
They said, they got problems with the garbage collection, but I think that
there's no one in the company anymore who understands what a (gc) is, and
how to implemented a better (gc) than they did.
a AutoLisp programmer (and Allegro user)
--
| Reini Urban alias ······@sbox.tu-graz.ac.at |
| AutoCAD Courses at the TU-Graz, Austria, |
| Architects Domenig-Eisenkoeck, Graz |