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
Arguably, all functional languages are descendants of Scheme to the extent that Scheme stumbled into, roughly, implementing the lambda calculus (though with quirks), and functional languages also implement the lambda calculus, though they don't necessarily always look like it. Also, arguably, the ML lineage is completely distinct because it goes back to Landin's ISWIM, which was influential but never implemented, had very little to do with Lisp, and from the start knew its theoretical foundations.
The real thing though is that Haskell and Lisp have much more in common with one another than either has with either the C family or the Prolog family.
I would have argued that folks should look past syntactic issues, but I forgot that Lispers define syntax as a key part of what it means to be a lisp. Which I think is goofy because then arguably Haskell isn't a Lisp, but Liskell is, even though the latter is basically a processor for the former.
Lisp is a very vague concept. I see two more or less useful interpretations:
Lisp as a family of languages which share some common ideas. In a wide interpretation very different languages belong to this family: Common Lisp, Scheme, Logo, Dylan, Emacs Lisp, Clojure, RLisp, 3Lisp and many, many others.
Lisp as a lineage of languages that are somehow implementing a core language (CAR, CDR, CONS, LAMBDA, PROG, SET, SETQ, QUOTE, DEFUN, IF, COND, DO, ...): Lisp 1.5, MacLisp, Lisp Machine Lisp, Emacs Lisp, Common Lisp, ISLisp. Note that these languages usually have 'Lisp' as part of their name.
Some typical things we find in Lisp dialects: strict evaluation, side effects, direct imperative programming, functional programming constructs, s-expressions, evaluation, macros.
Haskell is a very different language: non-strict evaluation, syntax not based on top of s-expressions, static typing, purely functional.
Haskell does not fit 1 nor 2. So, I would say Haskell is not a Lisp.
Similar we can say that a Functional Programming language is:
a language that supports Functional Programming: Lisp, APL, ..., ML, SML, OCAML, F#, Miranda, Haskell, ...
a language that enforces Functional Programming. Here Lisp already does not really fit in, since imperative or even object-oriented programming is not second class in Lisp.
a language that enforces Pure Functional Programming. Here we have Haskell as a good example. As a relatively new Lisp dialect Clojure also might fit in.
Usually Lisp does only support, but not enforce Functional Programming. So it is a Functional Programming Language in a wider interpretation.
Haskell is one of the languages that is seen as a Purely Functional Programming Language.
I'd say that both are functional languages, which makes them belong to the same family. However, I wouldn't call Haskell a Lisp derivative (like Scheme).
I think Haskell is a Lisp in the sense that they're both based on the λ calculus. Haskell is an implementation of λ.
Though most people would say that Haskell belongs to the ML family. ML is also based on λ, as are all functional languages I know of.
Under the hood, OCam (descended from ML) is compiled to combinatory logic, a formalism that is equivalent to λ calculus, and was invented by Haskell Curry, the logician whom Haskell is named after. But the use of combinatory logic for functional langauge compilation seems to be less popular nowadays, so I'm not sure about modern compilers like GHC.
Lisp's syntax is almost identical with λ calculus, which makes this family (Scheme, Clojure, etc) very special.
Hoyte compares some languages and claims that Haskell is NOT a Lisp for it is too strict in types and only for academics, whereas Common Lisp is more like a prototyping language (no strictness, dynamic typing).
See: Let Over Lambda—50 Years of Lisp by Doug Hoyte (an advanced book about Common Lisp, http://letoverlambda.com/)
Haskell and Common Lisp (probably all Lisps) are optimized against the functional programming (FP) paradigm. Haskell is pure, whereas Common Lisp is unpure. Contrast the term FP also with "total functional programming".
Also have a look at this diagram comparing programming language paradigms: http://www.info.ucl.ac.be/~pvr/paradigms.html
I would not agree with that. They're both functional programming languages and Lisp influenced Haskell, but Haskell is not a Lisp derivative. Just look at the amount of parenthesis and you can tell.