[Haskell-cafe] Re: Data constructors versus types

gwern0 at gmail.com gwern0 at gmail.com
Wed Jan 16 20:31:20 EST 2008

On 2008.01.17 00:58:19 +0100, jerzy.karczmarczuk at info.unicaen.fr scribbled 0.9K characters:
> Achim Schneider writes:
>> Lisp is actually not really meant to be compiled, but interpreted. The
>> nice thing is that it doesn't need more than a handful of primitives, a
>> list parser and heap manager/garbage collector and evaluator, which all
>> can be implemented in under 1000 lines of C. Things get more involved
>> with get/cc, but then how many C programmers ever heard of setjmp...
> Would you mind stopping to spread dubious truths?
> Certainly, Lisp processors started with simple eval/apply interpreters,
> since they were easy to construct, but compilers, their name is Legion!
> Look at CMU Common Lisp compiler.
> GNU CLISP compiler
> Lisp Works compiler
> Allegro compiler
> ...
> Jerzy Karczmarczuk

I don't think it's a dubious truth. Apparently a lot of Lisps (like Maclisp or Interlisp, I hear) had a situation where the semantics of a program could differ depending on whether it was compiled or interpreted, and Scheme and Common Lisp made a point of trying to avoid that.

In _Introduction to Common Lisp_, we read:
 "Most Lisp implementations are internally inconsistent in that by default the interpreter and compiler may assign different semantics to correct programs. This semantic difference stems primarily from the fact that the interpreter assumes all variables to be dynamically scoped, whereas the compiler assumes all variables to be local unless explicitly directed otherwise. This difference has been the usual practice in Lisp for the sake of convenience and efficiency but can lead to very subtle bugs. The definition of Common Lisp avoids such anomalies by explicitly requiring the interpreter and compiler to impose identical semantics on correct programs so far as possible." <http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node6.html#SECTION00510000000000000000>

Given that it was designed as interpreted, compilation was motivated by efficiency concerns, and interpreted techniques differed from compiled techniques (and in a way that would allow you to redefine and change more stuff on the fly), I think it's a reasonable case to say that many Lisps - like all the ones before Scheme and CL - were meant to be interpreted and not so much compiled.

NATIA DIA Burns espionage 97 utopia orthodox Meade cond SOCIMI
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080116/2cf27855/attachment.bin

More information about the Haskell-Cafe mailing list