This is incredibly big news in the Haskell world. The FP community is starting to break boundaries with the industry in the last 5 years with Clojure (and Scala's functional support).
Currently, FB seems to use haskell only for basic lexing and parsing[1]. It would be tremendous to see them using it at FB scale. I think there's going to be gain for both parties - For FB, the publicity and hacker outreach, and Haskell - industrial reliability.
There's this perception that Scala is less FP than a language like Clojure and I don't understand why, when in my (albeit limited) experience, I found the contrary to be true. This impression that's perpetuated is IMHO only folklore coming from people that only played around with these languages superficially.
Scala feels more like a functional programming language to me because:
(-) Code written in Scala tends to be more FP. One of the popular Scala frameworks, Play 2.0, is using Iteratees for dealing with responses and I/O in general, a concept used in Haskell, being pure awesomeness if you want to do Comet/Websockets. Play itself feels more reactive than Node.js, even though Node.js was built from the ground up for this. Also monadic types are used everywhere, from the standard collections to the Maybe monad (Option) to Futures/Promises. In Clojure you rarely see this, because Clojure is so dynamic that working with complicated container types is unfeasible.
(-) the Scala collections library provides more variants of immutable data-structures optimized for different things and those immutable data-structures in Scala are doing the right thing - first they play well with each other (e.g. mapping over a Map produces another Map if the function returns a tuple, but produces a Seq in case it returns a single element and there are many more examples where Scala simply knows what you mean).
Many times you pick concrete implementations like Vectors because of the provided invariants (e.g. indexing in O(1) or efficient adding/removing of elements on the right) and changing those invariants is IMHO bad design. Doing operations on a Vector like adding elements shouldn't produce a list, even if that list is lazy or whatever other reason. In Scala you know what operations are going to behave lazily because such invariants are encoded in the type. Adding/removing/transforming elements from a lazy Stream or view or other kind of lazy collection is still going to produce a lazy collection. And this is extremely useful in languages where laziness is not the default.
From the perspective of its rich collection of immutable collections, Scala is more functional than popular ML languages in general, except maybe Haskell. In Ocaml idiomatic code includes the usage of mutable collections, while in Scala the mutable versions are second-class citizens - and before you say that Clojure doesn't have mutable collections, think again - arrays are part of standard code and working with Java collections is quite comfortable and given as example in Clojure books.
(-) STM and atoms are great. I use STM in Scala a lot lately. However stuff like atoms and STM are still mutable state and come with many of the same gotchas as plain vars and pretending like this is otherwise is dangerous. Precisely for this reason it's useful to be able to implement your own atoms and your own STM mechanism that is more suitable to the problem at hand, that better encapsulates state and so on and because of the reality we live in, the internals of such components can get messy, while still keeping referential transparency for the outside world or other kinds of invariants - STM in Scala is a library (and quite nice in fact since it forces you to use Refs inside transactions with compile-time checks); Erlang-style Actors are a library too; Futures/Promises are a library too. All of them created with Scala.
(-) Scala is OOP while Clojure pretends like it isn't. I'm using "pretends", as multi-methods were introduced in CLOS, an OOP extension to Common Lisp, which made no effort to hide the fact that multi-methods are still all about OOP.
But just because OOP is very efficient (and has been used) to hide mutable state, that doesn't make OOP any less orthogonal to functional programming. Maybe tying up data with functions operating on that data leads to bad design, but besides the fact that type-classes are also part of idiomatic Scala and used everywhere, OOP is actually a quite nice and comfortable ad-hoc mechanism for polymorphism, being quite orthogonal to FP. Clojure is only able to have multi-methods and protocols because it is dynamic, but as far as FP is concerned this has drawbacks. Also in regards to multi-methods, I've seen code in the wild that dispatches on some global state instead of their arguments, since you can dispatch on anything and I'm really talking about mutable state.
IMHO I can't find evidence that Clojure is more FP than Scala. I'm more experienced with Scala than Clojure, so maybe this is why. But IMHO, Scala is more potent if you want to explore concepts of functional programming, being in my opinion the second choice after Haskell.
And I do think that this perception only has legs because Scala has a Java-like "while" loop and doesn't hide the fact that "vars" are really vars.
* Scala is statically typed, even using parametric types, while Clojure is dynamically typed
* Scala enables auto-currying when methods are defined in the Haskell style, while Clojure focuses on variadic functions
* Scala has easy-to-read syntax, with easy-to-remember operator precedences, while Clojure has syntactic macros instead
* Scala uses actors for concurrency, while Clojure uses its other approaches
Perhaps we shouldn't be considering them competitors but instead look for ways to more easily use them together, utilizing the strengths of each.
We could use Clojure macros to generate Scala source, e.g.
(defn object-main [s]
(str "object " pgm-nm "{\r\ndef main(args: Array[String]){\r\n" s "}\r\n}\r\n"))
(defn println [s]
(str "println(" s ")\r\n"))
(defn call-method [obj meth p1]
(str "(" (str obj) ")." meth "(" (str p1) ")"))
(object-main
(println
(call-method 1 "+" 2)))
We could create a whole library of such Clojure functions to generate Scala code, which would give us syntactic macros for the Scala ecosystem.And when Scala AST macros are mature, we could use them to generate Clojure code.
Using Scala and Clojure together would bring the best of both worlds to the JVM. Wouldn't that just be the grooviest?!
There is very little evidence of that. Do a search for Scala, Clojure or Haskell on the main indicator web sites (job boards, StackOverflow, TIOBE, indeed.com, etc...) and you'll find they are as insignificant today as they were five years ago compared to the mainstream languages.
The less said about TIOBE, the better.
The choices are way more today (Almost a tautology given old choices don't really vanish into thin air) and on more reliable platforms with tried and tested libraries.
anyway the spirit with which i meant that statement was that it is far easier to convince "senior management" and others with power to let stuff be done in clojure / Scala than it was to convince them about ml or clisp five years ago.
And I am not even talking about "ivory tower Haskell" (which i love using).
(Don't know enough about erlang / f# to comment).
So the sheer number of people using functional programming may not be very high even if functional programming is making inroads into industry. Now, I don't know whether functional programming actually is making inroads into industry or not, but my impression is that anybody relatively good at it could find a very nice functional programming job fairly easily.
Note that I have had 5-6 Jobs. I do FP for a living. And I have never been hired through a Job board advert. I think this is common with many FP people. Usually, when you want to hire FP people, you go to the mailing lists and community and get the guys you need. It is much more effective, but it won't show up in the Job board search at all.
I'm puzzled why you think this is good news for Haskell. The lead developer and architect of GHC and authority in parallel Haskell is announcing that he's taking a position that won't allow him to spend much time working on GHC, and he might even stop using Haskell completely.
It's great news for Simon but terrible news for Haskell.
However, if it gets major traction at someplace like FB, could be quite good for the language. cf. 37signals and Rails.
http://www.reddit.com/r/haskell/comments/13m8eu/haskell_leav...
It seemed to have been deprecated in favor of [2] when the original author of lex-pass left Facebook.
Sorry if any of this information is a little off/incomplete, I think it's been 2 years when I oversaw a BSc paper revolving around extending lex-pass.
[1]: https://github.com/facebook/lex-pass [2]: https://github.com/facebook/pfff
Other Functional languages are being used more as well, but since a huge amount of financial software sits on either a .Net or a Java stack, using FP languages which can easily interop with the rest of your libraries makes life a lot easier.
[1] http://en.wikipedia.org/wiki/Clean_(programming_language)
Simon might just be looking for a new challenge, with Haskell as his side hobby.
1. HipHop is itself written in C++. While this did not logically need to be the case, it is the case.
2. These days our JIT compiler, the HipHop VM (hhvm) is out-performing the PHP-to-C++ ahead-of-time compiler. HHVM is under the HipHop umbrella, and so is also written in C++. If you're vaguely aware that Facebook has some sort of high-performance PHP execution engine, but have avoided investigation because compiling PHP sounds like a drag, check hhvm out; it is fast, and you use it the same way you use a PHP interpreter.
3. HipHop is not our entire PHP stack, however, and functional languages have a significant beachhead in static analysis. pfff (https://github.com/facebook/pfff) is a sophisticated multi-language analysis and transformation framework written in OCaml. We use it for many, many purposes; e.g., at code review submission time, pfff symbolically executes the changed code to look for various dangerous idioms and highlight them as areas for the reviewer to focus attention.
4. There are other projects written in Haskell that, alas, we're not ready to talk intelligently about publicly. Watch this space, however.
Overall, FP has a sizable presence at Facebook. Haskell's presence is a bit smaller than OCaml, though that might be changing. Facebook is definitely "using Haskell more these days," especially since Bryan O'Sullivan (author of "Real World Haskell") came aboard. I expect Simon Marlow will continue to influence things in that direction. From 100k feet, Facebook's adoption of Thrift, and Thrift's tradition of supporting polyglot languages, means that a lot of "niche" languages can flourish within the larger production ecosystem.
best of luck to him at any rate. haskell and ghc are a cool language and compiler combo, one i have enjoyed for recreational programming time and time again.
The apparent cluelessness level of this statement is so high, I am unable to decide if this is just ignorance or very sophisticated trolling.
If the compiler dev working in a university or a research lab while developing the compiler is "terrifying", you should avoid C, C++, and Python, not to mention smalltalk, Pascal, Prolog, Common Lisp, Scheme, SML and OCaml ....
There is always PHP. Turing Completeness FTW.
Function invocation overhead, you say? Why would I want that?
How about Garbage Collection? It'll never work.
It's their responsibility to create foundational research, and it's ours to filter through it and prove the good bits with fire.
'Practical' is a red-herring, I think. We have no way to predict the future, but we all care about progress.
Yes, very much. He's one of the leading voices in the parallel Haskell world and a very accomplished programmer:
* http://hackage.haskell.org/package/stm
http://en.wikipedia.org/wiki/Generic_Java_(programming_langu...
Martin's work was related to generics, which got introduced in 1.5.
:)