Re: Request for comment: follow-up to Summer of Code
- From: Matthias Buelow <mkb@xxxxxxxxxx>
- Date: Wed, 29 Jun 2005 21:31:09 +0200
matthewknox@xxxxxxxxx writes:
>2 ways, really. One is that a good lisp implementation produces code
>with approximately the same effeciency characteristics as a that
>produced by a good C compiler, when given properly annotated lisp
>source. This can be contrasted with, say, perl, or ruby, or python,
>which do not, in my experience, produce very effecient code.
Well. There's little preventing someone from writing a compiler that
outputs machine code for one of those languages aswell, imho.
>The second is that there are a number of lisp operations that
>correspond directly to fairly simple machine instructions. As I
>understand it (cdr x) grabs whatever is stored at (the address stored
>in x) - c, where c is some constant that I cannot recall (5, maybe?) on
So, you mentioned Haskell as being "much farther away from any actual
machine". What is different with Haskell's "tail" that makes Lisp's
"cdr" so much nearer to the machine? (You give that as an example, not
I). I'd actually say that the "tail" is "nearer to the machine" simply
because the Haskell compiler doesn't have to deal with type checks at
runtime (which cdr normally has to) and as such can emit tighter
machine code.
>Scheme has the same thing-a tail call compiles down to a goto. I do
Tail call optimizations are provided in most functional language
compilers.
>not think that scheme and lisp are as close to the machine as they
>could be, but they are both excellent in this regard. I also mention
I'd say that Common Lisp (as standardized) aswell as Scheme (in R5RS)
are actually rather far from the machine. A real implementation might
of course extend the standard and provide mechanisms for dealing with
machine objects (such as word-sized integers, bytes etc.) but apart
from that, CL (and Scheme) are just as abstract as Haskell, ML, and
what have you. Not that I consider that abstraction level as bad, of
course.
mkb.
.
- References:
- Request for comment: follow-up to Summer of Code
- From: matthewknox
- Re: Request for comment: follow-up to Summer of Code
- From: Matthias Buelow
- Re: Request for comment: follow-up to Summer of Code
- From: matthewknox
- Request for comment: follow-up to Summer of Code
- Prev by Date: Re: ILC2005: McCarthy denounces Common Lisp, "Lisp", XML, and Rahul
- Next by Date: Re: ILC2005: McCarthy denounces Common Lisp, "Lisp", XML, and Rahul
- Previous by thread: Re: Request for comment: follow-up to Summer of Code
- Next by thread: Re: Hello-C mailing list?
- Index(es):
Relevant Pages
|