Live data from Hacker News

Functional Programming at Facebook

scs.stanford.edu

21–30 of 102 posts

Re: Functional Programming at Facebook

#21
post #14

Earlier quoted context omitted.

Although this reason sounds plausible, it is quite surprising since one of the first functional languages - Lisp was dynamically typed.

Lisp isn't a functional language.

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

#22
post #2

Well also WhatsApp handling 1B+ users with Erlang, and with (what used to be?) only a handful of engineers. But somehow the Haskell, OCaml and Scala users never want to include Erlang when talking about "functional". Even though it is probably the most practically used functional language.

> Even though it is probably the most practically used functional language.

Would love to get some evidence to back up Erlang being the most practically used functionally used language, because for all I know, it's hardly used at all these days.

Re: Functional Programming at Facebook

#23

Earlier quoted context omitted.

Because there's functional as in only using pure functions (Haskell, ocaml) and functional as in access to higher order functions (JavaScript, erlang, clojure)

> Because there's functional as in only using pure functions (Haskell, ocaml) This is not true. Having written a good amount of OCaml I would argue that programming with side-effects in OCaml is extremely approachable - almost as much as Clojure. There are mutable data structures in the stdlib (Array, Hashtbl) and IO etc. is straightforward. Like Clojure, there exists a ref type which can be easily mutated. It's one…

I'd distinguish between (at least) three degrees of “purity”:

(0) Absolutely anything goes. Examples: Racket (in the REPL), Lisp, Clojure, Scala, Erlang, etc.

(1) Values are immutable, but any computation might have any effect. Examples: Standard ML, OCaml (mostly), Racket (mostly).

(2) Values are immutable, and computations are type-annotated with their possible effects. Examples: Haskell, Idris, Ur/Web.

Re: Functional Programming at Facebook

#24
post #14

Earlier quoted context omitted.

Although this reason sounds plausible, it is quite surprising since one of the first functional languages - Lisp was dynamically typed.

Lisp isn't a functional language.

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

#25
post #16

Earlier quoted context omitted.

Because there's functional as in only using pure functions (Haskell, ocaml) and functional as in access to higher order functions (JavaScript, erlang, clojure)

> Because there's functional as in only using pure functions (Haskell, ocaml) and functional as in access to higher order functions (JavaScript, erlang, clojure) Or functional as having proper closures. Or tail call elimination. Or using immutable data, or immutable variables. Or minimizing mutable state. Or being decalrative. etc... ;-)

> Or functional as having proper closures.

Closures are an implementation detail.

> Or tail cail elimination.

Tail call elimination is just the right way to implement tail calls in a strict language.

> Or using immutable data, or immutable variables.

Variables don't “mutate”, they are substituted with other expressions. What imperative languages have is “assignables”.

> Or minimizing mutable state.

Functional programs have plenty of state - which changes over time. You can't have computation without traversing a state space - over time.

> Or being declarative.

What (technical!) definition “declarative” are you using?

Re: Functional Programming at Facebook

#26
post #21
post #14

Earlier quoted context omitted.

Lisp isn't a functional language.

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.

Immutable data structures don't “force” a functional style, cf. Prolog.

And Lisp is highly imperative even today.

Re: Functional Programming at Facebook

#27
post #13

> Even though it is probably the most practically used functional language. Scala have 30th place on Tiobe index, while Erlang have 42th: http://www.tiobe.com/index.php/tiobe_index .

https://en.wikipedia.org/wiki/Argumentum_ad_populum Has no relevance to actual language quality, potential or value. If this wasn't the case, then no language would ever pass, or fall behind, another language in popularity. Popularity is a reflection of already-realized value. That's all.

When trying to assess popularity, measuring "ad populum" is exactly the right metric (hint: look at the root of the word).

Re: Functional Programming at Facebook

#28

Earlier quoted context omitted.

In part, this is due to Haskell et al. are statically typed, which provides a higher safety guarantee than dynamically typed languages like erlang.

Although this reason sounds plausible, it is quite surprising since one of the first functional languages - Lisp was dynamically typed.

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

#29
post #2

Well also WhatsApp handling 1B+ users with Erlang, and with (what used to be?) only a handful of engineers. But somehow the Haskell, OCaml and Scala users never want to include Erlang when talking about "functional". Even though it is probably the most practically used functional language.

> Even though it is probably the most practically used functional language. Would love to get some evidence to back up Erlang being the most practically used functionally used language, because for all I know, it's hardly used at all these days.

Practicality is subjective, though. Unless you conduct an opinion poll, you will not find data objectively demonstrating that one language is more "practical" than another.

Re: Functional Programming at Facebook

#30
post #29

Earlier quoted context omitted.

> Even though it is probably the most practically used functional language. Would love to get some evidence to back up Erlang being the most practically used functionally used language, because for all I know, it's hardly used at all these days.

Practicality is subjective, though. Unless you conduct an opinion poll, you will not find data objectively demonstrating that one language is more "practical" than another.

Sure, but I interpreted OP's statement as saying "used in practice" as in "used in the real world".

Pretty sure that Erlang would barely register as a blip on such a chart.

Post reply on HN