News for hackers. Stuff that matters.
Re:Functional Programming at Facebook by rdtsc on Thursday February 25, 2016 @07:53PM (#11179137)
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.

Re:Functional Programming at Facebook by incepted on Thursday February 25, 2016 @09:54PM (#11179540)
> 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 by seiji on Thursday February 25, 2016 @10:37PM (#11179659)
"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 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 by tempodox on Monday February 29, 2016 @03:14AM (#11194207)
A language like Go that has political campaigns encoded in its compiler has creepiness written all over it. For me, this is a no-go area, pun intended.
Re:Functional Programming at Facebook by incepted on Thursday February 25, 2016 @11:13PM (#11179756)
> 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 claim to scalability.

Re:Functional Programming at Facebook by SanFranManDan on Friday February 26, 2016 @01:32AM (#11180105)
Riot Games is a pretty big one. Looking at erlangs site selecting a few:

AdRoll Facebook Chat TMobile

http://erlang.org/faq/introduction.html

Amazon SimpleDB Delicious From: http://stackoverflow.com/questions/1636455/where-is-erlang-u...

Also many of the companies using Riak (written in Erlang) also leverage erlang. Some pretty big names use it.

http://basho.com/about/customers/

I would say that Erlang has more than proved itself.

One aspect of it is that it is used more of an infrastructure language so not many people see it as glamorous as rushing out to the Go community to brag about their new backend. Its a lot of mature companies that have been around a while and don't really need to show off their infrastructure.

Also Elixir is gaining momentum (but still a blip) as a very viable language built on erlang.

Use what you want and what works.

Re:Functional Programming at Facebook by incepted on Friday February 26, 2016 @01:47AM (#11180146)
> One aspect of it is that it is used more of an infrastructure language

Ah yes, the "dark matter" argument. It's out there but nobody can see it. You'll just have to trust me.

Re:Functional Programming at Facebook by thinkpad20 on Friday February 26, 2016 @02:40AM (#11180261)
You posted asking for evidence of erlang being a practical, widely-used programming language. The posts in response have provided a huge number of examples of erlang not just "in production" but critically so. And yet, you seem to be resignedly unimpressed; all of your follow-up posts seem to be in the form of shrugs and harrumphs. What more are you asking for?
Re:Functional Programming at Facebook by incepted on Friday February 26, 2016 @01:46AM (#11180143)
I was asking for the names of the experts allegedly behind Erlang.

As for listing companies that use Erlang, plenty of companies use PHP and COBOL too. This doesn't say anything about whether these languages are the most adequate for the task and whether these projects wouldn't be in a better shape if written in a different language.

Re:Functional Programming at Facebook by querulous on Friday February 26, 2016 @02:03AM (#11180191)
robert virding, richard o'keefe, francisco cesarini, mike williams, joe armstrong, ulf wiger, brian troutwine, fred hebert, jose vadim, steve vinoski, serge aleynikov?
Re:Functional Programming at Facebook by troutwine on Friday February 26, 2016 @11:29AM (#11182246)
Aww shucks. Bless your heart.
Re:Functional Programming at Facebook by exclusiv on Friday February 26, 2016 @12:06AM (#11179892)
Not disputing your claim, but CouchDB is quite an impressive effort built on Erlang.
Re:Functional Programming at Facebook by muhmi on Friday February 26, 2016 @12:31AM (#11179951)
And Riak
Re:Functional Programming at Facebook by arthurcolle on Friday February 26, 2016 @12:41AM (#11179973)
and Elixir
Re:Functional Programming at Facebook by mavelikara on Friday February 26, 2016 @01:52AM (#11180163)
> Who are they, besides Joe? Can you at least provide their names?

One of them is here on HN: https://news.ycombinator.com/user?id=rvirding

Re:Functional Programming at Facebook by kyllo on Thursday February 25, 2016 @10:18PM (#11179620)
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 by incepted on Thursday February 25, 2016 @10:25PM (#11179631)
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 by im_down_w_otp on Friday February 26, 2016 @12:44AM (#11179977)
Almost all the successful non-Google ad networks and exchanges are written in Erlang, Goldman Sachs HFT platform is written in Erlang, several massive scale game platform backends are written in Erlang, several international "national net" banking switches are written in Erlang, a huge chunk of the global land-line and mobile telco switching infrastructure is written in Erlang, Heroku's control plane is written in Erlang, GitHub's RPC backplane is written in Erlang, Amazon SimpleDB is written in Erlang, Bet365's high-scale betting platform is written in Erlang, Pinterest is migrating services to Elixir (rooted in Erlang).

There's a ton of stuff written in Erlang out there. A lot of really core infrastructure services that have to just run and run and run.

It's not particularly trendy, but it gets shit done, and it does so with a quiet dignity. :-)

Re:Functional Programming at Facebook by mbrock on Friday February 26, 2016 @12:50AM (#11179996)
Do you have references for the claim about telco switching?
Re:Functional Programming at Facebook by querulous on Friday February 26, 2016 @01:51AM (#11180157)
http://erlang.se/publications/ericsson_review_axd301_1998012...

erlang was literally developed for telephone switches

Re:Functional Programming at Facebook by mbrock on Friday February 26, 2016 @02:01AM (#11180185)
That's a product from the late nineties. I have no idea how broadly it's used today.
Re:Functional Programming at Facebook by mhotchen on Friday February 26, 2016 @03:31AM (#11180413)
A talk by Joe Armstrong I watched recently indicated that around 50% of 3G and more than that of 4G infrastructure uses Ericsson technology, specifically with swoftware written in Erlang. He made a joke about 'sweating over every bit' sent over the network and then complaining that all the apps are going crazy with their JSON.

https://en.wikipedia.org/wiki/Ericsson#Products_and_services

Re:Functional Programming at Facebook by incepted on Friday February 26, 2016 @09:40AM (#11181568)
Erlang is mentioned only once in this entire article, and it's in the "See also" section. Nothing in this Wikipedia article supports the claim that Ericsson uses Erlang at all.
Re:Functional Programming at Facebook by mhotchen on Friday February 26, 2016 @03:28PM (#11183973)
Sorry, you're right. I was more indicating at the fact that they power a huge amount of the infrastructure of mobile and telecoms.

Here's some sources that indicate that Erlang is still in daily use at Ericsson:

http://www.ericsson.com/ericsson/corpinfo/publications/revie...

http://www.ericsson.com/news/141204-inside-erlang-creator-jo...

I'm sorry I can't find the exact video I saw from Joe, but he's generally quite proud of the reach of Erlang so you'll find him stating the facts about how much of the mobile and telecoms infrastructure it supports in a few of his videos! I hope that helps.

Re:Functional Programming at Facebook by rdtsc on Friday February 26, 2016 @10:18AM (#11181761)
Watch this video it explains clearly how it is used:

https://youtu.be/rQIE22e0cW8?t=662

And it is also fun!

Re:Functional Programming at Facebook by biokoda on Friday February 26, 2016 @01:52AM (#11180162)
That was the reason Erlang was created in the first place: https://en.wikipedia.org/wiki/Erlang_%28programming_language...
Re:Functional Programming at Facebook by mbrock on Friday February 26, 2016 @02:00AM (#11180182)
I know that. The last I heard was that Erlang decided to stop developing with Erlang, causing Armstrong and others to leave. I see they've reverses that decision and there are mentions of use at various mobile companies, so that's cool.
Re:Functional Programming at Facebook by abiox on Friday February 26, 2016 @12:02AM (#11179886)
RabbitMQ and CouchDB are written Erlang; Much of Ericsson's telephony infrastructure runs it; various companies in their industry like TMobile and Motorola use it.
Re:Functional Programming at Facebook by Everhusk on Thursday February 25, 2016 @08:51PM (#11179346)
The feature set of Facebook is much more complicated than WhatsApp. Most of WhatsApps features come out of the box with ejabberd too (which is what they used in the beginning). Is it really a fair comparison?
Re:Functional Programming at Facebook by rdtsc on Thursday February 25, 2016 @08:54PM (#11179359)
> The feature set of Facebook is much more complicated than WhatsApp

But the feature set of Facebook is not all implemented in Haskell or OCaml either. There is lots of PHP etc.

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

Re:Functional Programming at Facebook by dreamdu5t on Thursday February 25, 2016 @08:17PM (#11179228)
Because there's functional as in only using pure functions (Haskell, ocaml) and functional as in access to higher order functions (JavaScript, erlang, clojure)
Re:Functional Programming at Facebook by krat0sprakhar on Thursday February 25, 2016 @08:26PM (#11179257)
> 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 of the reasons why OCaml strikes as an extremely pragmatic language to me.

Re:Functional Programming at Facebook by catnaroek on Thursday February 25, 2016 @09:54PM (#11179541)
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 by i_s on Thursday February 25, 2016 @10:25PM (#11179633)
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.
Re:Functional Programming at Facebook by catnaroek on Thursday February 25, 2016 @10:32PM (#11179650)
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 by i_s on Thursday February 25, 2016 @11:49PM (#11179852)
No one is maintaining state by constantly clobbering namespace level variables in Clojure, though. What actually comes into play are ways the language and standard library encourages passing data around and manipulating it, which in Clojure is as immutable as you'll find in any language.
Re:Functional Programming at Facebook by catnaroek on Friday February 26, 2016 @12:50AM (#11179993)
Clojure encourages me to program in the REPL, because there is no other way to know what is going on in such a semantically crazy language, other than trial and error.

And the state of the Clojure REPL is as mutable and imperative as it gets, as my paste showed.

Re:Functional Programming at Facebook by greydius on Friday February 26, 2016 @03:40AM (#11180439)
You can rebind variables in ghci, too. I certainly wouldn't say this is evidence that Haskell promotes mutable data.
Re:Functional Programming at Facebook by catnaroek on Friday February 26, 2016 @03:52AM (#11180480)
> You can rebind variables in ghci

No, you can't: http://pastebin.com/SdbKM7V7

In ML and Haskell, a new variable might shadow an old one (if they have the same name), but they are still different variables.

Shadowing is slightly harder to implement than rebinding, but it provides a useful guarantee for the user: the meaning of existing definitions remains stable even if new definitions are introduced into the environment.

Re:Functional Programming at Facebook by greydius on Friday February 26, 2016 @04:13AM (#11180538)
You are correct. I failed to consider the implications of the different mechanics in the repl. I'm inclined to think the clojure repl is more conducive to experimenting. That is, you can change any part of your program to see what happens. I guess one programmer's sandbox is another programmer's hellish nightmare of mutability. For what it's worth, I would never redefine a var actual code, but I can't say it hasn't been done by others.
Re:Functional Programming at Facebook by catnaroek on Friday February 26, 2016 @04:33AM (#11180589)
> I'm inclined to think the clojure repl is more conducive to experimenting.

I'm inclined to think the Clojure REPL is more conducive to flailing around. Now, this might sound like derision, but it isn't intended that way: Flailing around can be a very time-efficient way to familiarize oneself with an unknown domain, especially if the cost of making wrong design decisions is small.

But at some point one has to consolidate what one already has, and, in my experience, Clojure makes this very difficult.

> I guess one programmer's sandbox is another programmer's hellish nightmare of mutability.

If you absolutely want mutable definitions, you can have them in Haskell (with some noise) and ML (with no noise) too: http://pastebin.com/00ScnFxC . So a Haskell or ML programmer always has at their disposal whatever they think is the best tool for the job.

Can I have it the other way around in Clojure?

Re:Functional Programming at Facebook by greydius on Friday February 26, 2016 @05:09AM (#11180673)
> Flailing around

Haha, yes. This is how I feel about Matlab, actually. But I suppose Clojure is no different in this respect.

I much prefer the Haskell approach: make dangerous things hard to do. Unfortunately, a majority of programmers consider that to be "unpractical".

Re:Functional Programming at Facebook by gclaramunt on Friday February 26, 2016 @09:54AM (#11181642)
Interestingly, Scala handles it http://pastebin.com/CT36K6Hj It feels like an artifact of the REPL tho, as one shouldn't be able to redefine x
Re:Functional Programming at Facebook by catnaroek on Friday February 26, 2016 @03:44PM (#11184089)
Yep, statically typed languages tend to have no option but to handle this right. Otherwise, they risk unsoundness: Consider what would happen if you did `val x = "foo"` instead of `val x = 0`.

But there's still no type-level distinction between immutable and mutable bindings, which is why included Scala in the “anything goes” category.

Re:Functional Programming at Facebook by rdtsc on Thursday February 25, 2016 @11:25PM (#11179788)
> Absolutely anything goes. Examples: Racket (in the REPL), Lisp, Clojure, Scala, Erlang, etc.

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 by Scarbutt on Thursday February 25, 2016 @08:32PM (#11179277)
leaving runtime asides, which do you enjoy more Ocaml or Clojure?
Re:Functional Programming at Facebook by krat0sprakhar on Thursday February 25, 2016 @09:43PM (#11179513)
To add to ohnomrbil's succinct reply, I absolutely enjoy being scolded by OCaml's compiler. The type inference is just marvelous and the code is almost as concise as Python etc. OTOH, the library ecosystem for OCaml is not even close to the stuff that's available for Clojure.
Re:Functional Programming at Facebook by ohnomrbill on Thursday February 25, 2016 @08:49PM (#11179339)
I use both, for different things. Clojure is more easily concurrent, and I love ClojureScript, so I tend to use it for web applications. OCaml is extremely useful for native code (I write a lot of personal productivity tools in OCaml).
Re:Functional Programming at Facebook by rdtsc on Thursday February 25, 2016 @09:13PM (#11179422)
> 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...

;-)

Re:Functional Programming at Facebook by catnaroek on Thursday February 25, 2016 @09:59PM (#11179563)
> 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 by rdtsc on Thursday February 25, 2016 @11:21PM (#11179773)
> Closures are an implementation detail.

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 by julian_1 on Thursday February 25, 2016 @11:07PM (#11179738)
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 by catnaroek on Thursday February 25, 2016 @11:20PM (#11179772)
Re:Functional Programming at Facebook by raould42 on Thursday February 25, 2016 @08:43PM (#11179310)
i thought ocaml ain't pure like that?
Re:Functional Programming at Facebook by julian_1 on Thursday February 25, 2016 @10:56PM (#11179712)
There are a couple of monadic IO systems for Ocaml - Lwt and Async which are pretty commonly used - and enable writing code using typed mutation/side effects.
Re:Functional Programming at Facebook by pauldirac137 on Thursday February 25, 2016 @09:11PM (#11179413)
You thought right. Ocaml is an impure functional language.