Earlier quoted context omitted.
> 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.
Functional Programming at Facebook
31–40 of 102 posts
Re: Functional Programming at Facebook
#32Earlier 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.
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
#33Earlier quoted context omitted.
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.
Pretty strange that you put Clojure in the "anything goes" category when it has been the clear leader when it comes to immutability. Lots of those languages you put in the other categories don't even have persistent data structures in their standard library.
This is particularly infuriating because the proper way to handle bound variables is already known: https://en.wikipedia.org/wiki/De_Bruijn_index .
Re: Functional Programming at Facebook
#34> 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://redmonk.com/sogrady/2015/07/01/language-rankings-6-1...
Re: Functional Programming at Facebook
#35Well 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.
But, "practical" doesn't show up on everybody's radar much these days with so much effort focused around fads-of-the-half-decade.
Erlang is made by professionals with decades of experience who grow the system towards being the most stable, scalable, safe, and as understandable as possible. People use Erlang, solve problems, stay quiet, then make money using it.
On the other hand, the thought leader these days seems to be Go (even though it's made by out of touch weirdos (review: http://www.evanmiller.org/four-days-of-go.html)) and has a creepy cult/fanatical following more suited to tribal sportsball teams than what we would expect from professional technical work needing to be stable over the long term.
Re: Functional Programming at Facebook
#36Earlier quoted context omitted.
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.
Out of curiosity: Would you consider Prolog a language in which you can do “denotational” programming?
Re: Functional Programming at Facebook
#37Earlier quoted context omitted.
Lisp isn't a functional language.
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…
Do you even know what an axiom is? (In mathematical logic, of course.)
Re: Functional Programming at Facebook
#38Earlier quoted context omitted.
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
#39Earlier 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)
i thought ocaml ain't pure like that?
Re: Functional Programming at Facebook
#40Earlier quoted context omitted.
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…
> Lisp is just axioms. Do you even know what an axiom is? (In mathematical logic, of course.)