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) 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 program…
Functional Programming at Facebook
41–50 of 102 posts
Re: Functional Programming at Facebook
#42Earlier 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.
"practical" as in: the programing model fits the problem domain model of modern systems. 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…
Who are they, besides Joe? Can you at least provide their names?
I'd really like to take a look at their credentials because beyond WhatsApp and an obscure Ericsson router from 20 years ago, there isn't much data to go by.
And there is plenty of evidence to show that C, C++, Java and more recently Go have some pretty strong success stories to justify their claim to scalability.
Re: Functional Programming at Facebook
#43Earlier quoted context omitted.
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.
Functional programming has always been the name of a programming paradigm that treats computation as the evaluation of mathematical functions.
Plenty of people will disagree with it too.
Re: Functional Programming at Facebook
#44Earlier quoted context omitted.
> 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 program…
Arguing about terminology and the correct definitions/properties of functional languages only demonstrates the point - that the properties of a functional language are context-sensitive and subjective.
Re: Functional Programming at Facebook
#45Earlier 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) 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 program…
Except when they are not there done properly (cough cough Python), it not so fun doing functional programming.
> Tail call elimination is just the right way to implement tail calls in a strict language.
Well Erlang is not strict and has tail call elimination. Because of lack immutability, recursion is used. Without tail call elimination recursion will blow the stack.
> Variables don't “mutate”, they are substituted with other expressions. What imperative languages have is “assignables”.
Yes they do. X=X+1 -- Variable mutated. Like it or not that is the bread and butter of programming. Unless someone did strictly functional programming and math. Then I can see how they'd be very confused by that statement.
There is also immutable vs mutable data. For example both Erlang and Elixir have immutable data. But Elixir has mutable variable, while Erlang doesn't.
As for assignables, I've never heard that word. I went to the standard 4 year CS program. Seemingly did a regular curriculum. Is that a translation from another langauge or a functional programming terminology?
> Functional programs have plenty of state - which changes over time.
Some have more, some less. Minimizing means making it explicit, passing it around, using immutable data. As opposed to say sticking it in a large object instance in a global singleton and then everything calls 100 something methods to mutate it.
> What (technical!) definition “declarative” are you using?
The point I think is, it is just as technical as "functional" is. It has a bit of a "No True Scotsman" thing going for it.
But as a heuristic think maybe about when you'd use patern matching to destructure something vs say a nested set of if and elses.
Re: Functional Programming at Facebook
#46Earlier 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.
Well you can't mutate variables and data in Erlang. (Try X=1,X=2 in a repl, it will fail). There is a thing called process dictionary but it is frowned upon. Concurency is handled by processes. But that's a different thing.
Re: Functional Programming at Facebook
#47Earlier quoted context omitted.
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.
Here is why: http://pastebin.com/t3Q3CW4j 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
#48Earlier quoted context omitted.
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.
Re: Functional Programming at Facebook
#49Re: Functional Programming at Facebook
#50Earlier quoted context omitted.
"practical" as in: the programing model fits the problem domain model of modern systems. 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…
> Erlang is made by professionals with decades of experience Who are they, besides Joe? Can you at least provide their names? I'd really like to take a look at their credentials because beyond WhatsApp and an obscure Ericsson router from 20 years ago, there isn't much data to go by. And there is plenty of evidence to show that C, C++, Java and more recently Go have some pretty strong success stories to justify their…