Is Haskell a Lisp?

前端 未结 9 1486
梦毁少年i
梦毁少年i 2020-12-09 02:33

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 Haske

9条回答
  •  情深已故
    2020-12-09 02:57

    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:

    • eager evaluation
    • dynamic typing
    • impure functional
    • macros
    • focus on lists as primary data structure

    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.

提交回复
热议问题