My question is, how much faster, and how much smaller?
Obviously this depends on many things. Let's assume for the purposes of
discussion reasonably good Lisp and C compilers. (e.g. Frantz Liszt, etc.;
I don't "speak" C, so insert your favorite C compiler here!) Let's also
assume you've made what modifications in your Lisp program you can to speed
it up, e.g. doing (sstatus translink on), using localf (assuming that
works, which it doesn't on my Sun...), setting up the allocation of space
for different forms of data so as to optimize garbage collection, etc.
Likewise whatever optimizations you can make to the C version.
The improvements gained by recoding in C also obviously depend on what kind
of a program you're recoding; so what programs are helped most?
Pointer-intensive ones?? Arithmetic-intensive ones?
On a large program, recoding the entire thing in C is probably not
worthwile (I would guess). How can you tell what parts would best benefit
from translation? (I assume here a Lisp like Frantz, which allows
calling of C functions from Lisp code.) Or does this really gain you
anything?
Have many people really done the translation? Or is it one of those things
that everyone talks about, but no one does anything about? :-) What gains
did you realize? Are there any published studies?
--
Mike Maxwell
Boeing Artificial Intelligence Center
..uw-beaver!{uw-june,ssc-vax}!bcsaic!michaelm
There's another issue beside time and speed, having to do with real-time
systems. A current net discussion bewails the plight of the poor F-16
pilot bounced by a Foxbat, when his or her Ada-coded countermeasures system
raises an error message due to run-time range checking. But imagine the
plight of the same pilot when the revised fire-control system -- rewritten
in Lisp -- says "Garbage Collection" and goes to sleep for a while.
(There are Lisp implementations that do incremental garbage collection, of
course.)
--
Jay Reynolds Freeman (Schlumberger Palo Alto Research)(canonical disclaimer)
Personally I think AI has been oversold.
Of course, the translation to C allows the developer an obvious
opportunity to rework the application to preserve needed features
while eliminating unneeded flexibility. I suspect the rewriting
is as important as the change in language.
--
scott preece
gould/csd - urbana
ihnp4!uiucdcs!ccvaxa!preece
What about having the C version be conscientious about using "malloc"
AND "free"? Though many people I know feel that dynamic storage
allocation is a "detail" that programmers need never worry much about,
I wonder if making sure to "free" anything you "malloc" is all that
hard.
I wrote my own slightly modified versions of "malloc" and "free" which
remember how many allocated blocks haven't been freed, and then prints
out an error message at the end of the program (I also modified "exit"
to do this) if all allocated blocks haven't been freed. Unfortunately,
I haven't had time to use these versions in recent work.
Has anyone out there REALLY used "free"? I'm very curious about this...
>> Personally I think AI has been oversold.
I'd like to shake your hand. I have my own opinions about AI that I
won't (and shouldn't) flame about, but KEEP THAT DISRESPECT FLOWING !!!
-- Rich
>> Has anyone out there REALLY used "free"? I'm very curious about this...
Well, I've used free immediately after doing a malloc; the routines in
question needed a considerable amount of space for some nonsensical
operation, and in the convolution which ensued there were several
different places where the function might legitimately return. Since
free doesn't trash the space, but merely makes it available for re-use,
I wasn't living so perilously as it might appear.
I should probably caution the folks at home against trying this; were I
rewriting that stuff today I'd certainly be a bit more conventional and
less obscure (i.e., put the free at the bottom of the function and goto
it), but I was young then...
--
Joe Chapman decvax!cca!emacs!joe joe@cca-unix
"The dubious practices admitted to herein are no longer
even my own, and the fabric of the software with which
I and my employer are now associated is devoid of even
a suggestion of them."
No, no, no. People seem to think AI => LISP. *That* has been oversold, real AI
hasn't been developed yet and so can't be sold.
(If I have posted this twice, I apologize, I got a swap error somewhere in
posting).
George Williams
decvax!frog!aphasia!gww
God bless you, in case you sneeze.
Yep, I do in packet switched memory server simulators. I am allocating
and freeing packets all the time. That is until I realize that I am
spending too much cpu time in malloc and free. One then only mallocs
10000 of them at a time and links them into a free list which a packet
allocator pmalloc and pfree operate out of.
.
Ask anyone who has ever developed a piece of commercial code for a small
machine. (Yes, Virginia, there are people who develop applications for IBM
PC's...) I, for example, am currently working on a product that will operate
on potentially megabytes of data, and must run in 256 to 512 K of physical
memory, with no help from virtual memory. You'd better believe we're careful
to match every malloc with an appropriate free!
-------------------------------------------------------------------------------
Matt Landau ARPA: matt%mirror@cca
Mirror Systems, Inc. UUCP: {decvax!cca, ima!inmet, mit-eddie, wjh12}...
Cambridge, MA ...mirror!prism!matt
-------------------------------------------------------------------------------
Blessed are they that run around in circles, for they shall be known as wheels.
Peter Ashwood-Smith
Human Computing Resources,
Toronto Ontario.
I used to use it in an old version of a parser I had, it worked
quite well, although I never really got down and benchmarked it.
--
Mikel Manitius - ...{ihnp4|akguc|attmail|indra!koura}!codas!mikel
YES. Some of us have to write programs that will run to completion in 64K, or
feel that cutting down the size of programs is a good idea. Yes, I free() every
pointer I malloc() as soon as I no longer need it.
Thanks,
Terry Poot
Nathan D. Maier Consulting Engineers
(214)739-4741
Usenet: ...!{allegra|ihnp4}!convex!smu!ndm20!tp
CSNET: ndm20!tp@smu
ARPA: ndm20!tp%s...@csnet-relay.ARPA