Hacker News new | ask | show | jobs
by tel 3770 days ago
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.

1 comments

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.

Scala I don't have too too significant experience with but it continues to feel like a functional language with commitment issues to me.

I think Prolog counts here, too. But it's a weirder one.