CL subset?

From: Chris Capel (ch.ris_at_iba.nktech.net)
Date: 11/21/04


Date: Sat, 20 Nov 2004 19:44:13 -0600

I've read that a program can be a conforming subset implementation of CL in
the case that any programs written in that subset will run as intended,
unmodified, on a fully conforming CL implementation. The primary advantage
that I can see to this sort of thing is to optimize the size of the runtime
required for deployment (disk/memory footprint, startup times). In fact,
given the right subset, it might be possible to do development on a full
version of CL and then deploy with the subset. For instance, the majority
of programs could run fine without a compiler or debugger (or EVAL) in the
final image. Many small ones could make do without various other features
(the reader, the condition system), although some would be harder to take
out or modularize than others.

I think there are probably quite a few people developing small systems
intended for widespread, casual use, that would voluntarily choose to use
such an implementation--sacrificing the more dynamic features of the
language in a conscious effort to create smaller distributables. In the
case of COMPILE and friends, they wouldn't be giving up much at all.

Some of the comments in
http://www.nhplace.com/kent/CL/Public-Review-PRobertson.html
seem to be particularly apt here.

Now, it seems the most obvious way to implement this sort of thing is to
have flags in the source of a full implementation that exclude different
portions of the runtime. For instance, one might specify:

./configure --no-compiler --no-reader --simple-conditions \
  --sources foo.fasl bar.fasl --entry-point bar-main

... where the fasls were compiled with a full version of the same
implementation, and the resulting executable (possibly multiple files)
would jump straight to that code. Do any free implementations have this
capability, or anything like it? If not, are there any separate
implementations being maintained that only implement a sizable subset of
CL?

-- Flamebait --

Perhaps a good answer to this question would help to bridge the culture gap
and satisfy the newbies with the perennial "HOW DO I COMPILE AN EXE WITH
LISP" question. It might make lisp more suitable for lightweight,
non-serious tasks that attract hobbyists who have the time to write the
sort of neat, *little*, libraries for various things that make a language
less intimidating for newbies and pragmatists with small requirements.

After playing with Lisp for several months, the thing that still strikes me
the most about it is its monolithic nature. And it doesn't really strike me
as necessary, either. I see nothing essential to the spirit of Common Lisp
that makes the sort of runtime we have available in most implementations
necessary. I think that's a shame. It may be (and it wouldn't surprise me)
that I'm woefully underestimating the technical difficulty of putting this
sort of functionality into an implementation, but don't tar and compress me
for that.

I tend to agree with Paul Graham (as I read him) in that a language that's
good for free-time projects of little consequence is the best kind for
becoming a great language for hackers. Take that as you will.

Chris Capel



Relevant Pages

  • Re: Program compression
    ... TM> supported by your favorite language (LISP) are good concepts. ... then call the Java compiler to compile that source file to a Class ... TM-STC> Since static type checking makes run-time type checks unnecessary, ...
    (comp.programming)
  • Re: Structure of a lisp system. Contd...1
    ... Most Common Lisp systems have a way to save an image, ... language background. ... or you can avoid object-oriented programming entirely ... Many Common Lisp systems compile to machine code (with the ...
    (comp.lang.lisp)
  • Re: lisp and writing virtual machines..
    ... When you get them you compile them and then ... Of course, with lisp you're coding ... lisp I could get that for free though, just by translating my language ... It seems to me that for most programming languages one could easily ...
    (comp.lang.lisp)
  • Create New Dictionary Problem Sort by Position
    ... The language I want to create the dictionary for is an accented ... Microsoft provides me with a utility where I have to sort my list ... utility to compile my list, the list has to be sorted. ...
    (microsoft.public.word.docmanagement)
  • Re: if does not evaluate
    ... for a summary of the sort of stuff people actually *do* in Lisp. ... Maybe Lisp (and therefore Lisp books) are designed for intelligent ... language standard; maybe books are considered necessary to teach ...
    (comp.lang.python)