5 ms·
Why is Haskell a lisp? It is the first time I hear someone classifying Haskell in the “List Processing” family of languages, and although it does process lists
by nudpiedo 7y ago
Why is Haskell a lisp? It is the first time I hear someone classifying Haskell in the “List Processing” family of languages, and although it does process lists I thought its main paradigma symbol and code representation goes in a complete different direction, more into pure function oriented programming.
- dreamcompiler 7y agoWhen people say something "is a Lisp" that usually has little to do with list processing. It's about whether it inherits more from lambda calculus than from Turing machines.
- lispm 7y agoLisp literally stands for 'List Processor'. To claim that it has little to do with it, is really really strange. One of the main reasons to create Lisp was being able to compute with 'symbolic expressions', represented as linked cons cells in the form of lists... McCarthy about Lisp: === As a programming language, LISP is characterized by the following ideas: computing with symbolic expressions rather than numbers, representation of symbolic expressions and other information by list structure in the memory of a computer, representation of information in external media mostly by multi-level lists and sometimes by S-expressions, a small set of selector and constructor operations expressed as functions, composition of functions as a tool for forming more complex functions, the use of conditional expressions for getting branching into function definitions, the recursive use of conditional expressions as a sufficient tool for building computable functions, the use of lambda-expressions for naming functions, the representation of LISP programs as LISP data, the conditional expression interpretation of Boolean connectives, the LISP function eval that serves both as a formal definition of the language and as an interpreter, and garbage collection as a means of handling the erasure problem. LISP statements are also used as a command language when LISP is used in a time-sharing environment. === http://jmc.stanford.edu/articles/lisp/lisp.pdf http://jmc.stanford.edu/articles/lisp/lisp.pdf 'lambda calculus' wasn't even explicitly mentioned. But he mentions s-expressions, list structure, multi-level lists, ...
- dreamcompiler 7y agoThe Lisp community has moved on from McCarthy's taxonomy. In McCarthy's day, there were two high-level computer languages (Lisp and Fortran) and now there are thousands. Today we have different notions of what constitutes a "Lisp-like" language and what doesn't. By McCarthy's strict definition, Clojure is not a Lisp because it doesn't use real cons cells. But I think most people nowadays would agree that Clojure belongs in the Lisp family more than in the Algol family. Haskell has (very!) first-class functions and is even more naturally compositional than most "classical" Lisps. It feels to me like a Lisp with static typing, laziness, and automatic currying cleverly incorporated. Likewise Javascript. Javascript feels like a Lisp to me because it has lexical closures. It gets in my way because its syntax and many other design choices are terrible, but it still feels like it descends from lambda calculus. I guess my point is that whether a language is a Lisp or not can't be reduced to a simple list of bullet points.
- lispm 7y agoNeither Clojure, Haskell nor Javascript are Lisp. Haskell and JavaScript are not even directly derived from Lisp. Your idea of Lisp lacks any concrete features and suddenly all languages would be Lisp: Prolog, Haskell, ML, SML, Javascript, Java, ... all of them have sone form of functions. This then is arbitrary. Lisp is a family of languages which share concepts and code. There are a number of concepts (you call it bullet points) which make a language a member of the Lisp family in a wider sense and it may not be that all members share all concepts, but MOST and the important ones, Haskell for example is very very different from Lisp: syntax, semantics and pragmatics. There is no way one would consider Haskell a member of Lisp languages. Lisps are not statically typed, they are not lazy, they don't use currying, they are not side effect free, etc. If a languages has all these features at its core, it's not Lisp. Claiming that it is Lisp is just creating confusion. Give a student a Lisp book (say Peter Norvig's PAIP) and a Haskell compiler: nothing runs, the concepts and architectures are different, the development style, basically everything. Pure Functional Programming has been split from Lisp decades ago in the 70s and 80s and we have now thousands of language camps (not just two: Fortran and Lisp). The core of Lisp is still the same: List processing, dynamically typed, a specific form of evaluation, garbage collection, s-expressions with symbols, code represented as s-expressions, built-in code transformations over s-expressions, procedures are called functions, higher-order functions, eager evaluation, optional interpretation of code in the form of s-expressions, interactive development with read-eval-print-loops, etc etc. From there new languages families have been forked or maybe only influenced: purely functional PLs (Haskell), logic languages (Prolog), object-oriented languages (Smalltalk, Self) and many others. Smalltalk is also not Lisp, even though it got stuff like images, GC, blocks, interactive interface, and others via Lisp influence...
- iLemming 7y agoHaskell is "lispy" because it's based on lambda calculus