

What is a functional programming language? - bendmorris
http://enfranchisedmind.com/blog/posts/what-is-a-functional-programming-language/

======
knowtheory
I think we would be remiss to mention that fundamentally the Lambda Calculus
and Turing Machines are mathematically equivalent, as proved in the Church-
Turing Thesis (<http://en.wikipedia.org/wiki/Church%E2%80%93Turing_thesis> ).

And while it is true that there are functional features that are unsupported
in the basic syntax of imperative languages, you can still do equivalent
computation, and after all "Whoever does not understand LISP is doomed to
reinvent it" :P

~~~
cyrus_
54\. Beware of the Turing tar-pit in which everything is possible but nothing
of interest is easy.

—Alan Perlis, Epigrams on Programming

~~~
knowtheory
ha, that's great.

I have to say learning about Lisp and the Lambda Calculus renewed my interest
in computation and programming back in university. I really find Turing
machines quite dull.

Perhaps i did not adequately disclaim my statements though. Having to hack a
LISP into your imperative language is neither easy, maintainable or
recommended. Just cause you can do it, doesn't mean you should ;)

The rest of the epigrams:

[http://www-pu.informatik.uni-tuebingen.de/users/klaeren/epig...](http://www-
pu.informatik.uni-tuebingen.de/users/klaeren/epigrams.html)

------
cyrus_
The lambda calculus admits no notion of mutability, while the Turing machine
is all about mutating locations on a tape. So I would argue that functional
programming is really about immutability.

A language is a functional programming language if its standard library
includes and is written specifically for immutable data structures. Mutable
data structures, if they exist, are second class citizens.

Whether there is an object system is completely orthogonal. Whether there are
first-class functions is also completely orthogonal.

~~~
jmillikin
This is a very odd definition; it would exclude many languages typically
considered "functional", such as Haskell.

~~~
cyrus_
Haskell's core data structures are immutable (ADTs, tuples, records, etc.) --
what do you mean?

~~~
cyrus_
Let me clarify that a bit further -- I'm not excluding languages which offer
mutable data structures, even in standard libraries. I'm simply excluding
languages where the use of these data structures are de-emphasized.

This isn't a precise scientific definition of a functional language, but one
that seems to quite cleanly differentiate languages like Haskell and ML from
languages like Javascript and C#, all of which have first-class functions.

~~~
dfox
Your definition also clearly differentiate between "Common Lisp as is taught
on universities" and "Common Lisp as it's actually used", which might or might
not be a good sign.

------
scottjad
Functional means whatever the person saying it means by it.

Trying to give an all or nothing definition is doomed to failure and counter-
examples.

~~~
knowtheory
“When I use a word,” Humpty Dumpty said, in a rather a scornful tone, “it
means just what I choose it to mean—neither more nor less.”

“The question is,” said Alice, “whether you can make words mean so many
different things.”

“The question is,” said Humpty Dumpty, “which is to be master that’s all.”

Alice was too much puzzled to say anything, so after a minute Humpty Dumpty
began again. “They’ve a temper, some of them—particularly verbs, they’re the
proudest—adjectives you can do anything with, but not verbs—however, I can
manage the whole lot! Impenetrability! That’s what I say!”

and just for completenesses sake:

Alan Perlis — 48. The best book on programming for the layman is "Alice in
Wonderland"; but that's because it's the best book on anything for the layman.

~~~
rufus_t
It, and "Through the Looking-glass", are very good books on programming for
programmers, too. If you haven't read them since you were liddle, you're
missing out.

------
Zak
The author claims that Clojure tries to do OO. While Clojure does allow
interaction with Java's object model, I think it's quite a stretch to say that
it tries to do OO. Use of Java interop features for purposes other than
interacting with a Java library or framework is generally discouraged.

~~~
swannodette
The article is a year and a half old. Clojure doesn't "try" to do OO-
multimethods always worked pretty well, and with 1.2.0 it does OO _very well_.

Clojure design philosophy is essentially "OOP: The Good Parts".

~~~
mahmud
For there to be "Good Parts" of OOP, there would have to be a single kind of
OOP.

P.S. Smalltalk.

~~~
loewenskind
That doesn't follow. If we define "OOP" to encompasses everything that anyone
calls OOP then it's very possible for there to be "good parts" and "bad parts"
in that set.

P.S. Smalltalk is a beautiful language with a great deal to offer anyone, but
multimethods are superior. The fact that multimethods don't require multiple
dispatch patterns demonstrates this.

