[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Scheme has data types and Lisp doesn't."



In article <9085@thorin.cs.unc.edu> bts@evergreen.cs.unc.edu (Bruce Smith) writes:
>I hope someone here can explain the origin of this notion that
>"Scheme has data types and Lisp doesn't".

Probably this statement refers to older dialects of Lisp which used dynamic
scoping, making static type inference difficult. Also, older lisp dialects
tended to do everything with cons, as opposed to vectors etc.

As for Scheme vs. Common Lisp, the main differences are Common Lisp has
more available data types (such as displaced arrays) and CL also gives
the user some tools for manipulating/enforcing types (declare, typep,
subtypep etc.)

>Most recently, in a discussion of which functional programming
>language should be taught to students (not at UNC, by the way)
>I heard that Scheme was to be preferred because compiled Scheme
>executes much faster than compiled Common Lisp.  The reason for
>that difference?  Because, of course, "Scheme has data types
>and Lisp doesn't."

I don't believe this (and I currently maintain both Scheme and CL
compilers). CL could potentially execute slower than Scheme because
it has more features (like keyword arguments, sequence functions, etc).
However, if you compare CL programs with these feature to Scheme programs
which "are the same", then usually the CL programs are more efficient.
This is because the compiler knows about the extra features and most
of the time has efficient ways of doing them.

Hope this helps,

John
gateley@m2.csc.ti.com