[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hello



>Wouldn't be an important requirement for the language to support a
>programming style that allows one to guarantee timely responses?

First, there is nothing in the structure of any programming language
that ensures (or forbids) timely responses.  You can write fast code
in Lisp, and you can write slow code in C.  (In fact, as most of CLisp
is written in C it could be argued that when you are running CLisp you
are really running a C program.)

Second, there are various scales of timeliness on spacecraft.  The
fastest events happen on a time scale of about an eight of a second, but
there are very few things that have to happen that fast, and these are
mostly things like control loops or low-level device drivers that are
more naturally written in C anyway.  Then there are responses that have
to happen on time scales on the order of a few seconds.  With a little
careful coding you can guarantee that kind of response in Lisp even if
you get a garbage collection.  Finally, if you need really fast response
in Lisp you can do pre-emptive garbage collection at times when response
is not critical.

Finally, I believe that the reason that Lisp is often thought of as a
slow language is that it provides very powerful, general programming
constructs that are necessarily more expensive than less powerful, less
general constructs provided by other langauges.  Automatic memory
management is the premier example of such a feature.  The ease with
which dynamic data structures are created in Lisp tends to encourage
their use.  By contrast, dealing with dynamic data structures in C is
so painful that programmers go out of their way to avoid them, and as
a result C code tends to run faster.  But there is nothing in the structure
of Lisp that prevents writing algorithms that don't cons.  It's just that
most Lisp programmers know that the time and cost of tracking down bugs
and memory leaks when destructive operations are used is so high that
it's usually not worth it.

E.