News for hackers. Stuff that matters.
Re:Functional Programming at Facebook by meridional on Thursday February 25, 2016 @08:23PM (#11179248)
In part, this is due to Haskell et al. are statically typed, which provides a higher safety guarantee than dynamically typed languages like erlang.
Re:Functional Programming at Facebook by krat0sprakhar on Thursday February 25, 2016 @08:28PM (#11179264)
Although this reason sounds plausible, it is quite surprising since one of the first functional languages - Lisp was dynamically typed.
Re:Functional Programming at Facebook by tel on Thursday February 25, 2016 @10:15PM (#11179616)
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.

Re:Functional Programming at Facebook by catnaroek on Thursday February 25, 2016 @10:37PM (#11179662)
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?

Re:Functional Programming at Facebook by joostdevries on Friday February 26, 2016 @01:46AM (#11180142)
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.
Re:Functional Programming at Facebook by catnaroek on Friday February 26, 2016 @02:24AM (#11180234)
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.

Re:Functional Programming at Facebook by tel on Friday February 26, 2016 @09:55AM (#11181648)
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.

Re:Functional Programming at Facebook by nilved on Thursday February 25, 2016 @09:05PM (#11179389)
Lisp isn't a functional language.
Re:Functional Programming at Facebook by seiji on Thursday February 25, 2016 @10:31PM (#11179649)
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.

Re:Functional Programming at Facebook by mbrock on Friday February 26, 2016 @12:48AM (#11179985)
"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.

Re:Functional Programming at Facebook by catnaroek on Friday February 26, 2016 @12:55AM (#11180016)
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.

[dead]
Re:Functional Programming at Facebook by dang on Friday February 26, 2016 @01:01AM (#11180033)
> Do you even

Any comment that begins with that is unlikely to be a good fit for HN. Please post civilly and substantively, or not at all.

https://news.ycombinator.com/newsguidelines.html

https://news.ycombinator.com/newswelcome.html

Re:Functional Programming at Facebook by catnaroek on Friday February 26, 2016 @01:57AM (#11180176)
Not saying nonsense (“Lisp is just axioms”) is part of being civil.
Re:Functional Programming at Facebook by dang on Friday February 26, 2016 @02:24AM (#11180233)
There's a big difference between being wrong and being abusive.

We don't want programming language flamewars on HN, so please don't conduct them here.

Re:Functional Programming at Facebook by incepted on Thursday February 25, 2016 @09:56PM (#11179552)
You're both right and wrong, it's just that "functional" has a lot of different definitions and nobody can agree on which one is correct.

As a result, "functional" has become pretty much meaningless when describing a programming language.

Re:Functional Programming at Facebook by catnaroek on Thursday February 25, 2016 @10:49PM (#11179695)
Functional programming has always been the name of a programming paradigm that treats computation as the evaluation of mathematical functions.
Re:Functional Programming at Facebook by incepted on Thursday February 25, 2016 @11:18PM (#11179764)
That's one of the many definitions we have for it, yes.

Plenty of people will disagree with it too.

Re:Functional Programming at Facebook by sova on Friday February 26, 2016 @01:20AM (#11180083)
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.

Re:Functional Programming at Facebook by catnaroek on Friday February 26, 2016 @01:57AM (#11180173)
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.

Re:Functional Programming at Facebook by vitno on Thursday February 25, 2016 @09:49PM (#11179528)
This person is getting downvoted... but it isn't.

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.

Re:Functional Programming at Facebook by catnaroek on Thursday February 25, 2016 @10:02PM (#11179578)
Immutable data structures don't “force” a functional style, cf. Prolog.

And Lisp is highly imperative even today.

Re:Functional Programming at Facebook by pjmlp on Friday February 26, 2016 @01:12AM (#11180058)
They talk about Clojure because they weren't even born when we were using Lisp systems.
Re:Functional Programming at Facebook by pjmlp on Friday February 26, 2016 @01:10AM (#11180052)
CS language papers from the 50 and 60 don't share that opinion.
Re:Functional Programming at Facebook by coldtea on Friday February 26, 2016 @05:29PM (#11184778)
If you have been around 10 years ago, including on HN, everybody considered Lisp not only "a functional language", but "THE functional language".

Heck, Haskell was barely ever mentioned.

Not to mention that the whole idea of functional programming was introduced to the programming world with McCarthy and Lisp.

(Except if you want to say that "Lisp is not functional, it supports many paradigms" -- but I find that tired. It is, at its core, functional).

Re:Functional Programming at Facebook by akio on Friday February 26, 2016 @12:38AM (#11179964)
Erlang does has static analysis though, through Dialyzer.

http://erlang.org/doc/man/dialyzer.html