Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Possible Duplicate:
What are some well known applications written in F#?

I see a lot of people talking about how cool functional programming is, how awesome Lisp and Haskell and F# are, etc, but what I don't see is them actually being used. Just about every program on my computer is written in either something in the C family, Delphi, or Python. I see tutorials talking about how easy it is to use functional languages to do complicated math problems, but no one talking about using them to do things most people actually care about using computers for, like business applications and games.

Does anyone have any examples of actual programs that people have heard of and are using, written in a functional language? The only one I can think of off the top of my head is Abuse, from almost 15 years ago. (Things like Emacs, where the core program is written in C with a functional language scripting layer on top, don't count.)

share

locked by World Engineer Jun 25 '13 at 2:54

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

marked as duplicate by JohnFx, Macneil, ChrisF Dec 1 '10 at 8:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3  
I think you're confusing functional programming with functional languages. For instance, I've successfully applied a lot of functional programming concepts from Real World Functional Programming using C#. The language now has a lot of functional features. –  Scott Whitlock Nov 28 '10 at 17:12
    
Some vital parts of the New York Stock Exchange run on Scheme. You may not have "heard of" it, but you probably "used" it! –  Macneil Nov 28 '10 at 18:02
2  
if that was really true, pure FP would have taken over the world already on merit alone. The expressiveness of a language is only one part of the productivity equation. A language must also have good libraries and adequate support for I/O, both of which are common criticisms of Lisp specifically, and pure functional languages in general. This makes functional languages good for some problem domains, but not so good for others. By contrast, imperative languages are the "swiss army knife;" getting the job done may not be pretty, but it will get done. –  Robert Harvey Nov 28 '10 at 18:34
12  
When did any programming language ever "take over the world on merit alone"? In fact, when did anything take over the world on merit alone? Everything that ever took over the world did this either by accident, by marketing or by sheer luck. Java took over the world because CPU vendors wanted to screw Intel using the JVM, OS vendors wanted to screw Microsoft using the JVM, application vendors wanted to stay out of the OS and CPU fight using the JVM. Nobody actually cared about Java. It just happened to be bundled with the JVM. –  Jörg W Mittag Nov 29 '10 at 3:27
5  
Closed as a duplicate? What duplicate? I see the F# question noted above, but believe it or not, F# isn't the only functional programming language. –  mipadi Dec 1 '10 at 14:33
show 11 more comments

12 Answers

I don't know of a lot of games or end-user applications written in functional languages, though I'm sure there are some. Games and end-user applications, though an important and visible part of the software market, are only a part of it. Remember, there is huge amounts of software out there that you never see because it is orchestrating processes that don't have end-user application or game interfaces.

For example, F# is popular at Credit Suisse for quantitative analysis:

http://blogs.msdn.com/b/dsyme/archive/2010/07/15/f-jobs-at-credit-suisse-london.aspx

Unless you work there, you're probably not going to ever see the user interface to that software.

Or, Erlang is popular for writing the software that controls mobile phone switches:

http://en.wikipedia.org/wiki/Erlang_(programming_language)

You probably don't think of making a phone call as an application, but someone had to write the software that controls the switch.

share
1  
+1 for pointing out that not all programs that get written are publicized over the internet. –  Larry Coleman Nov 28 '10 at 22:13
    
+1 exactly as Larry says, it is popular, just not with the sort of companies that go in for open source. –  Orbling Nov 29 '10 at 3:02
    
+1 for Erlang in the telecom industry. –  Chinmay Kanchi Nov 30 '10 at 22:44
add comment

Ever used a modern website, lots of Javascript, tons of people using jQuery?

Well that's effectively a functional language, closures, functions as first-class objects, etc.

Everywhere, millions of users day by day.

share
2  
+1 for pointing out that JavaScript does the whole FP bit too –  Gary Rowe Nov 29 '10 at 23:29
    
Probably the most widely experienced of the functional [multi-] paradigm languages. –  Orbling Nov 30 '10 at 0:35
add comment

Erlang is in use at Facebook, Yahoo, and Amazon. It's also running embedded in Ericsson and Nortel ePBX (electronic Public Branch Exchange) telecom switches with ridiculous uptime. CouchDB is written in Erlang, as is ejabberd. There are more now, and more coming every day. Check out Totally Erlang for Erlang jobs to see who's working on what.

share
add comment

Lisp dialects are used all over the place - but it's not really mainstream... yet

Jak and Daxter (YouTube demo) was written using GOAL (Game Oriented Assembly Lisp). From the Gamasutra review, I quote (emphasis added for clarity):

5. GOAL rules! Practically all of the run-time code (approximately half a million lines of source code) was written in GOAL (Game Object Assembly Lisp [acronym correct?]), Naughty Dog's own internally developed language, which was based on the Lisp programming language. Before you dismiss us as crazy, consider the many advantages of having a custom compiler.

Lisp has a very consistent, small set of syntactic rules involving the construction and evaluation of lists. Lists that represent code are executed by evaluating the items that are in the list; if the head of the list is a function (or some other action), you could think of the other items in the list as being the parameters to that function. This simplicity of the Lisp syntax makes it trivial to create powerful macros that would be difficult or impossible to implement using C++.

Other software written using Common Lisp includes:

the list goes on. It's fair to say that although Lisp is not exactly a fully mainstream language, it certainly solves a lot of difficult problems in a neat and elegant way.

share
7  
A fascinating and scary comment comes from the last line of the Wikipedia article on GOAL: "GOAL's primary development and maintenance engineer is no longer available to Naughty Dog, and so they are transitioning to a C++ based pipeline for future projects." Which means that they bet their company on one programmer and when he quit they don't know how to deal with the language/framework he wrote. –  Tangurena Nov 28 '10 at 18:02
    
Very interesting stuff. Apparently you can change out code while the application is running, a feature reminiscent of Erlang. –  Robert Harvey Nov 28 '10 at 18:41
1  
@Tangurena Good spot. It seems inconceivable that no-one would have thought to do an ongoing knowledge share/handover. –  Gary Rowe Nov 28 '10 at 18:42
1  
@Tangurena, nothing wrong in using a talented programmer - just see what John Carmack does - and it also appeared to have worked very well. The glitch here is that Naughty Dog forgot to have the knowledge shared across others. The socalled bus factor. –  user1249 Nov 28 '10 at 18:44
1  
Interesting, but from the Wikipedia article it appears that the language is designed for imperative, object-oriented programming with little support for functional style or garbage collection. They basically re-implemented C++ in Lisp. (What would Greenspun say?!?) –  Mason Wheeler Nov 28 '10 at 21:24
show 9 more comments

Orbitz uses Lisp extensively for it's flight lookup engine.

share
    
I was aware of this example, but the actual letter (as opposed to Paul Graham's claims about it) make it apparent that this one falls squarely in the Emacs category. –  Mason Wheeler Nov 28 '10 at 17:24
    
If you say so. I doubt Orbitz would consider their creation a "scripting engine." –  Robert Harvey Nov 28 '10 at 17:28
    
Yeah, they probably wouldn't. But if it quacks like a duck... –  Mason Wheeler Nov 28 '10 at 18:45
    
@Mason: This whole "Emacs doesn't count" exception is strange and makes the question less constructive. I think it could be improved. –  Macneil Nov 29 '10 at 0:12
4  
@Mason Wheeler: the only part of GNU Emacs that is not written in ELisp is the ELisp VM. And that is only because of portability. The original versions of Emacs were written on Lisp Operating Systems which directly understand Lisp code, so they were 100% Lisp. –  Jörg W Mittag Nov 29 '10 at 3:22
show 3 more comments

Functional Programming is not just limited to a particular language, its also a style of coding in my mind.

When I say style of course I'm ignoring the "pure" functional requirement of not including any states..

In that sense, I suspect its used a lot in daily situations.

Just to give you an example, in a recent project I used "functional" style of programming to transform URL's into dynamic Site-maps (tree structure) on the fly. This was done by breaking down the problem into smaller functions which was then composed together to create the final solution : Data In -> Function (F1+F2+Fn) -> Tree

share
    
+1 for demonstration, but I don't think that's exactly what the OP was looking for. –  Michael K Nov 28 '10 at 22:18
add comment

Xmonad, a windowing manager, is written in Haskell.

share
1  
I respect their effort, but to me Xmonad is a niche (a X11 window manager) in a niche (used on operating systems minus Windows/Mac). I am not sure whether mentioning Xmonad is not amplifying the impression that functional programming is a niche. –  LennyProgrammers Nov 30 '10 at 9:14
add comment

It's used in the industry by the minority that understand how and have the opportunity to use it. The majority of programmers won't understand recursion or things like first-class functions and that you can treat a function as a value and store it in a list. I'm not trying to sound elitist but the reality is the use of functional languages is limited because the vast majority of programmers can't get it. Sure lot's of people use Javascript but whether they use it in a functional way is another question.

Anyway here's a list of some organizations/people that use/used functional languages:

  • Paul Graham used Lisp to make a web store that got sold to Yahoo back in the day when Yahoo was king of the net.
  • Citrix use OCaml for the management tools for Xen.
  • The Halo team used F# internally
  • Fairly sure a lot of banks are using F# at the moment.
  • Ericsson use Erlang

But at the end of the day the language used makes little difference to the outcome of the project. The best programming language in the world won't save you from bad management implementing bad processes that have design and requirements proceeding for months and then expecting the 1000000 lines of documentation converted into working and tested code in 3 months.

share
add comment

Igor Engraver, a music notation program, is written in Lisp.

share
add comment

Lots of financial analysis used to be done in APL, from earlier responses it sounds like they've transitioned to F# today.

share
add comment
share
add comment

Perhaps not in a purely functional language, but I use functional paradigms all the time when I write python and javascript.

share
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.