Just to double down on the points of some other commenters here: "Functional" is a pretty difficult word to pin down these days. That said, there seems to be a clear camp in what might be better called "denotational" programming which centers around the ML-alike languages, the dependently typed languages, and Scala.
Lisp is not much at all like these languages. Nor is Erlang, though it is vastly closer.
I wouldn't call Scala a “functional” language. It's an object-oriented language that happens to be able to encode many Haskell idioms, with varying degrees of awkwardness. But you can write Java in Scala too, and, in the eyes of some, the result will even be more natural.
Out of curiosity: Would you consider Prolog a language in which you can do “denotational” programming?
I would call Scala a functional language. In the sense that object-orientation and FP are not eachothers opposite. Imperative and FP are.
I guess awkwardness is in the eye of the beholder. I think it's an elegant language with which it is a joy to develop large code bases.
I never said object-orientation and functional programming are opposites. (You can use objects to compute mathematical functions.) And, for that matter, imperative and functional programming aren't opposites either. (You can use imperative procedures to compute mathematical functions.) See: https://news.ycombinator.com/item?id=11180173 .
The awkwardness I'm talking about comes primarily from the non-orthogonality of Scala's features. For instance, there are situations where subclasses and implicits are both reasonable alternatives for a given programming task. On the other hand, in ML and Haskell, it is often clear which language feature is the right tool for the job.
That's a very HN comment. Completely wrong but delivered with strong convictions.
Lisp doesn't actually exist. Lisp is just axioms. You run an implementation of Lisp allowing various operations. Some flavors actually have (practically) zero mutability. You just create functions and cons cells and the rest of the world gets built on top of those.
But, pure functional systems are useless (to be purely functional would mean you can't even do I/O... your program would just heat up the computer, which, in a way, is its own form of output, so you can't ever be fully functional).
Every functional language gets non-functional at some point for data processing, bootstrapping, loading/saving programs, and the best functional languages even have optional mutability constructs for performance (see: !). You can't create the most performant data structures possible if all your operations require path copying, but mutability should be reserved for internal high performance library creation and avoided in business logic/application level code to make systems easier to reason about.
"Lisp doesn't exist" is also kind of wrong but with conviction, or at least debatable. Lisp was standardized in 1994 as ANSI Common Lisp, and there are a handful of other Lisp-like languages.
And pure languages aren't useless. Not being able to do I/O can be good for many purposes. Pure Haskell is still able to model computations involving I/O, which are then executed by a trusted external runtime. There are benefits to disallowing arbitrary effects, which is also why several new languages take purity even further and disallow infinite recursion.
For clarification, in a deduction system, an axiom is a proposition that is true just because. Similarly, an axiom schema is a predicate, such that substituting its free variables with closed terms yields a proposition that is true just because.
Now, I repeat, how exactly is Lisp “just axioms”? What are the axioms in question? The mathematical ignorance of some of Lisp's proponents never ceases to amaze me.
Please correct me if I am off the right track here, but is not the distinction the fact that:
in a "functional language" or maybe "parenthentical up-cup evaluating language"
functions are invoked in an encapsulating way, and no state is kept between function-cup-up-segments-of-code, but there is a R.E.P.L that (replies) when you invoke a (parens) which is, in LISP-land known as a program.
However, now that I have mind-dumped that ^ I recall haskell and erlang also being called "functional" but I don't know their syntax any more than a chimpanzee knows that the sun is round.
Functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions. A function is a rule that assigns, to every element of its domain, a unique element of its codomain.
Note that the above definition says nothing about how functions are to be evaluated: strictly, lazily, memoizing previously computed results, or using magic. No general-purpose programming paradigm can make such decisions for the programmer.
Lisp, especially in it's early implementations is highly imperative. This is why when people talk about Clojure they always talk about Immutability, it's part of what forces a functional style on the language.
Lisp is not much at all like these languages. Nor is Erlang, though it is vastly closer.