I've been reading The Haskell Road to Logic, Maths and Programming by Doets and Eijck 2004. It seems to be a well respected book, but I was struck when it claims that Haskell is a member of the Lisp family. Is this accurate? I would characterise Lisps with s-expressions, impure functions, and lists as the only composite data structure. Haskell has none of that. What justification is there for that claim?
相关问题
- Generating powerset in one function, no explicit r
- Understanding do notation for simple Reader monad:
- Making Custom Instances of PersistBackend
- Haskell: What is the differrence between `Num [a]
- applying a list to an entered function to check fo
相关文章
- Is it possible to write pattern-matched functions
- Haskell underscore vs. explicit variable
- Top-level expression evaluation at compile time
- Stuck in the State Monad
- foldr vs foldr1 usage in Haskell
- List of checkboxes with digestive-functors
- How does this list comprehension over the inits of
- Replacing => in place of -> in function type signa
What people define as a lisp varies. The original specification for a lisp didn't mention macros at all and only defined a small list of primitive function, which, if my memory serves me, are the following:
cons
car
cdr
cond
eq
atom
and
or
not
nil
This might not be the full list, or it might have few additional members, but in any case, John McCarthy's original specification was very small.
If you define a lisp as any language that defines all of those functions, then most modern languages are lisps, including haskell.
A more strict and modern definition of a lisp is as follows:
Haskell doesn't fit the first 3, it's macros (template haskell) don't follow the code-is-data paradigm, and while lists are very important, they're not the primary data structure.
So I would say no, Haskell is not a lisp.
Haskell is not lisp of course. Everyone has his own understanding what the heck "lisp" is. IMHO lisp is a language where the source code is a valid structure in that same language. Haskell source code is not a valid structure in haskell, hence they have to have a separate syntax (Haskell Template) to manipulate their own source code.
But there's at least one interesting feature in haskell that reminds me of lisp. Its the syntax of function calls: func args1 agr2 arg3. Lisp has EXACTLY the same syntax: (func args1 agr2 arg3). In fact you can include outside parens in haskell too. All other algol family languages introduce parens and commas between function name and arguments.
I think that it is a stretch to consider Haskell as a member of the LISP family, but I suspect the reasoning goes something like this...
When classifying programming languages, it is meaningful to divide them into two groups: those descended from FORTRAN and those that are not. In 1958, the "not FORTRAN group" pretty much meant LISP (at least, among the languages that are not extinct today). So, for a time, the programming language family tree had two main branches: the FORTRAN descendants and the LISP descendants. If those are the only two choices, then I would put Haskell into the LISP branch.
However, many commentators consider languages like ML, Prolog and APL to have arisen "out of the blue" -- introducing sufficiently distinct paradigms to merit lineages unto themselves. Haskell is clearly kin to ML.
As examples of such classifications, see the following programming language family trees:
O'Reilly's Programming Language Poster
Computer Languages Timeline at levenez.com
HOPL: an interactive Roster of Programming Languages (Haskell Entry)