Re: Beyond CL?
- From: "Tron3k" <tron3k@xxxxxxxxx>
- Date: 21 Jul 2005 20:55:36 -0700
paulgraham wrote:
> We have to invent genuinely new things. Things,
> moreover, that people like John McCarthy, Gerry Sussman, and
> Guy Steele didn't think of. That's not so easy.
I agree. Luckily, we have an advantage: we are standing on their
shoulders. Man of 10,000 years ago had the same brain, and thus the
same intelligence as we do now. Cultural evolution alone has brought us
to this point, and it will, I believe, carry us forward.
One promising idea is to move towards the greater ability to poke
around in the internals of the language. How about this: Lisp is known
as the programmable programming language; what we lack is a
programmable *compiler*. Imagine being able to define one's own code
generation optimizations when you have identified a bottleneck in your
program. Eventually a bank of many users' optimizations could be
collected together, resulting in something that might asymptotically
approach the fabled "sufficiently smart compiler".
However, such things can only be done when the language itself is
defined completely transparently from a small number of basic axioms.
As you say, source code often makes the best spec. It also gives
serious hackers the ability to get down and dirty into the internals of
the language.
Perhaps the compiler should be defined in the spec of the language;
that is, there exists a well-defined translation of source code to
primitive low-level constructs. (I don't mean anything like a
translation to a particular architecture, such as x86.) This should
allow the programmable compiler to become a realistic possibility.
One way to generate new ideas is to think of all the strangest things
we could possibly want to do, and make them possible. In one of your
essays, you said you wanted to iterate through the fields of a struct,
but Common Lisp wouldn't let you. That should be possible. What else
should be?
o Perhaps it should be possible to define (2 (pr "hi")) to print "hi"
twice. (Not that anyone would want to do that - or would they? - but
such a thing should, in principle, be possible. Note that this cannot
be done with a code walker since the number in the first position could
actually be a variable. Now that I think of it, a more realistic
suggestion would be for (2 (fn () (pr "hi"))) to print "hi" twice.
Nevertheless.)
o Perhaps it should always be possible to interrogate a closure, and
retrieve its code and its environment. (Yes, there exists
FUNCTION-LAMBDA-EXPRESSION. The point is, it's not guaranteed to work.)
o Perhaps it should be possible to define extremely high-level
optimizations as well as the low-level ones I mentioned. As an example,
consider automatically memoizing all functions determined to be purely
functional, or automatically compiling partially specialized versions
of functions (e.g. in a raytracer, a ray-sphere-intersect method
specialized for a certain sphere) when it is determined that this would
improve execution speed. Yes, we have methods to do things like this in
CL, but we don't have clean ways of making the magic happen on its own.
In CL, you have to *think* about doing either of these things.
This approach seems promising. It seems to me that Lisp-space is an
infinite domain in which we can see but a small distance away from
where we are standing. Even heading in the wrong direction is better
than stubbornly staying in the same place, although it seems many are
comfortable there and resent being poked by those who have seen a small
glimpse of the treasures that lie around them.
"I do not know what I may appear to the world; but to myself I seem to
have been only like a boy playing on the seashore, and diverting myself
in now and then finding a smoother pebble or a prettier shell than
ordinary, whilst the great ocean of truth lay all undiscovered before
me." - Isaac Newton
Tron3k
.
- Follow-Ups:
- Re: Beyond CL?
- From: Paolo Amoroso
- Re: Beyond CL?
- From: Pascal Bourguignon
- Re: Beyond CL?
- From: André Thieme
- Re: Beyond CL?
- From: Matthias Buelow
- Re: Beyond CL?
- References:
- Beyond CL?
- From: Jamie Border
- Re: Beyond CL?
- From: Joe Marshall
- Re: Beyond CL?
- From: paulgraham
- Beyond CL?
- Prev by Date: Re: Lisp programming and RSI (Repetitive Strain Injury)
- Next by Date: Re: Beyond CL?
- Previous by thread: Re: Beyond CL?
- Next by thread: Re: Beyond CL?
- Index(es):
Relevant Pages
|