Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Haskell a Lisp?

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?

like image 903
Bob Bobson Avatar asked Jan 14 '11 22:01

Bob Bobson


People also ask

Is Haskell based on Lisp?

Haskells in LispYale Haskell - written between 1991 and 1993; was built from sources using CMU Common Lisp, Lucid Common Lisp, Allegro Common Lisp, Harlequin LispWorks, Kyoto Common Lisp. The last did suffer from performance problems, though. Compiled binaries were available for Sparc systems running SunOS 4.1.

Why is Lisp better than Haskell?

Some of the features which are provide by Haskell which make it better choice to use over Java, C and other programming like: modularity, laziness, functional language, maintainability etc. One of its features include wide support for control structure which makes it good choice for artificial intelligence.

What type of language is Haskell?

Haskell (/ˈhæskəl/) is a general-purpose, statically-typed, purely functional programming language with type inference and lazy evaluation.

Why is Haskell not popular?

The reason is quite obvious. The facilities and elegance of Haskell are very different from the needs of most mainstream programming. Haskell just isn't the right tool for these jobs. One of the most common patterns in popular programming is runtime polymorphism.


1 Answers

Lisp is a very vague concept. I see two more or less useful interpretations:

  1. 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.

  2. 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:

  1. a language that supports Functional Programming: Lisp, APL, ..., ML, SML, OCAML, F#, Miranda, Haskell, ...

  2. 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.

  3. 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.

like image 57
Rainer Joswig Avatar answered Sep 28 '22 18:09

Rainer Joswig