Haskell是Lisp吗? [英] Is Haskell a Lisp?
问题描述
我一直在阅读Doets和Eijck撰写的《 Haskell逻辑,数学和编程之路》(2004).这似乎是一本备受推崇的书,但是当我声称Haskell是Lisp家族的一员时,我感到震惊.这是正确的吗?我将用S表达式,不纯函数和列表作为Lisps的特征,并将其作为唯一的复合数据结构. Haskell没有任何东西.该主张有什么理由?
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?
推荐答案
Lisp是一个非常模糊的概念.我看到了两种或多或少有用的解释:
Lisp is a very vague concept. I see two more or less useful interpretations:
-
Lisp是一种语言,具有一些共同的想法.在广泛的解释中,这个家族有非常不同的语言:Common Lisp,Scheme,Logo,Dylan,Emacs Lisp,Clojure,RLisp,3Lisp以及许多其他语言.
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是一种以某种方式实现核心语言(CAR,CDR,CONS,LAMBDA,PROG,SET,SETQ,QUOTE,DEFUN,IF,COND,DO等)的语言:Lisp 1.5,MacLisp,Lisp机器Lisp,Emacs Lisp,Common Lisp,ISLisp.请注意,这些语言通常在名称中包含"Lisp".
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.
我们在Lisp方言中发现一些典型的事物:严格评估,副作用,直接命令式编程,函数式编程构造,s表达式,评估,宏.
Some typical things we find in Lisp dialects: strict evaluation, side effects, direct imperative programming, functional programming constructs, s-expressions, evaluation, macros.
Haskell是一种非常不同的语言:非严格评估,不基于s表达式的语法,静态类型,纯功能.
Haskell is a very different language: non-strict evaluation, syntax not based on top of s-expressions, static typing, purely functional.
Haskell不适合1也不适合2.所以,我想说Haskell不是Lisp.
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:
-
一种支持函数式编程的语言:Lisp,APL,...,ML,SML,OCAML,F#,Miranda,Haskell,...
a language that supports Functional Programming: Lisp, APL, ..., ML, SML, OCAML, F#, Miranda, Haskell, ...
一种强制执行功能性编程的语言. Lisp在这里已经不适合使用,因为命令式甚至面向对象的编程在Lisp中并不是第二类.
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.
一种强制执行纯函数式编程的语言.在这里,我们以Haskell为例.作为一种相对较新的Lisp方言,Clojure也可能适用.
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.
通常,Lisp仅支持而不执行功能编程.因此,它是一种功能性编程语言,具有更广泛的解释.
Usually Lisp does only support, but not enforce Functional Programming. So it is a Functional Programming Language in a wider interpretation.
Haskell是被视为纯功能编程语言的语言之一.
Haskell is one of the languages that is seen as a Purely Functional Programming Language.
这篇关于Haskell是Lisp吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!