by noosphr · 1y ago · 0 comments
Lisp is not, nor has it ever been, a functional programming language. It had lambda decades before other languages figured out it was a good idea, but it had set! for just as long.
It is also not a list based language, but a tree based one. The fundamental point of lisps is that you can manipulate the abstract syntax tree directly since it's pretty much the same thing as the parse tree.
>Deep Nesting is Rare
>The lisp's cons [...] works just fine when data structure used is simple. [...] vast majority of list usage is just simple flat list, sometimes 2 level of nesting [...] 3 levels of nesting is seldom used [...] Greater than 3 level is rarely seen. Systematic manipulation and exploitation of nested list, such as mapping to leafs, to particular level, transposition by permutation on level, or list structure pattern matching in today's functional langs, etc is hardly ever to be seen.
I guess the author has never used lisp to implement a DSL in lisp. Writing a lisp interpreted in lisp is the first real program you write if you take a lisp course at university and you need to handle arbitrarily nested expressions.
Real world usage also involves writing a specialist language to solve your problem for anything more complex than a utility script, e.g. Emacs is a text editing DSL implemented in elisp.
Purity has nothing to do with functional programming.
> It is also not a list based language, but a tree based one.
It's not called Trep, it's called Lisp. Yes, you can represent trees as lists embedded in lists, and the cons cell allows that thanks to type recursion. But it's still based around lists. Trees don't allow cycles, lists formed from ordered pairs do. Every single piece of literature written by McCarthy talks about lists[1].
> The fundamental point of lisps is that you can manipulate the abstract syntax tree directly
Macros weren't introduced until 1963[2]. They might be the reason you use a Lisp, and they may have become synonymous with Lisp after 1.5, but they are not a "fundamental point" of Lisp. The fundamental point was always about lambda calculus[1].
[1] - https://history.siam.org/sup/Fox_1960_LISP.pdf
[2] - http://bitsavers.informatik.uni-stuttgart.de/pdf/mit/ai/aim/...
When Lisp was implemented for the first time, the evaluation semantics was already expressed as operations on a tree.
"Functional programming" used to just mean having first-class functions that you could pass as arguments and return from functions. Lisp has always been functional. It's never been purely functional, which is a different thing - concerning itself with referential transparency rather than first-class functions.
I was around when FP papers still discussed Miranda, and Lisp was certainly taught as FP language.
The LISP I manual describes the program feature as being "like a FORTRAN program with LISP statements", but that's not the same as saying it is there to appeal to Fortran programmers.
https://www.mirrorservice.org/sites/www.bitsavers.org/pdf/mi...