5 ms·
All the languages he suggests apart from Scala are or are pretty close to being pure functional languages. I'm not convinced that I would be more productive de
by jiggy2011 15y ago
All the languages he suggests apart from Scala are or are pretty close to being pure functional languages.
I'm not convinced that I would be more productive developing say a web app , database app or game using say Haskell rather than Java or Python especially since a large amount of programming is all about state and side effects.
I'm not against learning a pure functional language as a way to improve your programming especially for concurrency or to solve specific problems.
Are there any large pieces of software outside of academia that are written primarily in functional languages?
- jberryman 15y ago> Are there any large pieces of software outside of academia that are written primarily in functional languages? If you're asking about places where FP is often used, I know it's big in finance (though I have no idea what those guys are up to). The haskell web development space has also gotten to a pretty mature point. I think you'd have no problem building a web app with Yesod or Snap. http://www.yesodweb.com/ http://www.yesodweb.com/ http://snapframework.com/ http://snapframework.com/ You could also check out http://cufp.org http://cufp.org
- corysama 15y agoJane Street is pretty well known for their use of OCaml in finance. http://janestreet.com/technology/articles.php http://janestreet.com/technology/articles.php
- zak_mc_kracken 15y ago> If you're asking about places where FP is often used, I know it's big in finance I've heard this a few times (mostly from the Scala crowd) but very little data to back it up, so I'm still skeptical.
- nandemo 15y agoI wouldn't say FP is big in finance. On the other hand, financial companies are probably over-represented among the industrial users of FP. There are several prop trading firms (Jane Street, Tsuru Capital, etc) that use functional languages heavily. Also, many of the big banks (Credit Suisse, Deutsche Bank, Barclays, etc) use some FP in production, but as far as I know it's only used by small, strategic groups. FWIW I've interviewed or applied at many of those big banks in Tokyo and not one of them ever mentioned interest in FP skills. As far as I could gather the typical developer there doesn't know or is not interested in FP.
- weaksauce 15y agoI don't know how far over to the functional paradigm arc leans but hacker news is programed in it. I know it's built off common lisp so there is that linage. The naughty dog game studio used a form of lisp in their games starting with Crash Bandicoot until they got purchased by Sony(I think). Though, the language was much more imperative in nature instead of functional. Autocad had autolisp built into it. http://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp http://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp I don't know of any others off the top of my head.
- jiggy2011 15y agoI wonder if the lack of state is why I keep getting the "Unknown or expired link" message all the time? I see allot of functional DSLs (Excel for example + autocad as you pointed out). Was crash bandicoot written in Lisp or was this just an internal DSL used for certain operations? I don't have anything against functional languages and I'm sure all good developers should know at least 1 but the article seems to suggest that everyone should use them all the time. There are more important things than having an expressive language, I use allot of Java which is seriously non expressive in many ways but I have more confidence in it to solve the category of problems I deal with than any other language that I have tried thus far.
- wahnfrieden 15y agoI appreciate your interesting comments, but just FYI, it's "a lot" not "allot". I wouldn't normally point out a spelling error but I noticed it enough to be distracting and thought you might not know (in case of ESL).
- andolanra 15y agoNaughty Dog used an internally developed programming language for the whole game (or at least most of it.) A big part of the appeal was apparently the dynamic nature of Lisps, which allowed reloading of code at runtime to simplify debugging. This article is a postmortem about Jak and Daxter; the next page also mentions the drawbacks of using GOAL, as well: http://www.gamasutra.com/view/feature/2985/postmortem_naughty_dogs_jak_and_.php?page=2 http://www.gamasutra.com/view/feature/2985/postmortem_naught...
- kd0amg 15y agosince a large amount of programming is all about state and side effects IANA web developer, but... Doesn't web development typically put state into a database system instead of the scripts the server runs to generate the requested pages? It seems reasonable enough to have a function that takes a page request as input, calls some other functions to look up info from the database, then constructs and returns a page and a sequence of changes to make to the database.
- jiggy2011 15y agoYou can do allot with a database sure but sometimes you want multiple transactions within a single request and data will change between them. You may also take input from other sources than a database such as flat files, web APIs emails etc and need to do a bunch of processing between them. Not to mention if you are using Comet or something where you hold a request open for a long time and push and pull allot of data some of which may not be persisted immediately. Sure you can probably write your controller logic in a pretty functional way but then you probably end up moving your messy logic into stored procs or something else.
- kd0amg 15y agosometimes you want multiple transactions within a single request and data will change between them Is this an issue with race conditions, or with alternating between reading and writing the state during a single request, or both, or something else entirely? You may also take input from other sources than a database This doesn't seem like it should make a difference: you write a function to get the necessary data from whatever source, then call that function in the page request handler (OK, yes, I/O is technically a side effect). I agree that the processing you do with that data might require some significant rethinking, depending on how it was written/planned out before (sure, state-passing style is always there, though I don't enjoy doing it... really though, I've found that a lot of what I was used to doing imperatively is not all that awkward to do functionally). Not to mention if you are using Comet or something where you hold a request open for a long time and push and pull allot of data some of which may not be persisted immediately. What's the conventional way to do this in an imperative language?
- lelele 15y agoGalois is a company which uses functional languages, mainly Haskell if I'm not mistaken: http://corp.galois.com/ http://corp.galois.com/ If I'm not mistaken, Jane Street is another functional programming shop: http://www.janestreet.com/ http://www.janestreet.com/ These are companies using OCaml: http://mirror.ocamlcore.org/wiki.cocan.org/companies.html http://mirror.ocamlcore.org/wiki.cocan.org/companies.html
- dagw 15y agoI also know of at least a couple of large investment banks that have significant Haskell projects in house for doing things like options modelling.
- gtani 15y agoThe other day i ran a blog about haskell at Standard Chartered (written in, um, Hungarian?) thru google translate. Very entertaining! But SC is probably becoming a substantial codebase
- jerf 15y ago"I'm not convinced that I would be more productive developing say a web app , database app or game using say Haskell rather than Java or Python especially since a large amount of programming is all about state and side effects." Haskell isn't about avoiding side effects. It's about managing them. Seriously, it's time to drop this criticism. Obviously Haskell can "do things". It may not have thousands and thousands of apps of every type, but when it has an X window manager, a DVCS, and a few web frameworks under its belt, it clearly isn't about "not having side effects". (Nor is that a complete list; my point is that is sufficient evidence to show that things can be done, not a complete app list.) Every functional language you've ever heard of has reasonably serious apps, but I'm not sure there's one yet where you won't encounter at least one of 1. a tooling problem (Erlang, Haskell) or 2. an impedance mismatch between the tooling and the language (Scala, Clojure). Time is correcting this problem rapidly, but if you don't feel like being on the cutting edge (and that's a fine position to take), I wouldn't push them on you. (But I would say that all four of those languages I mentioned are indeed the cutting edge and have come off the bleeding edge. Real work can be done in them if you stick to their strengths, but you may hit some bad error messages, or road blocks you'd normally just download your way around.)
- andolanra 15y ago"...especially since a large amount of programming is all about state and side effects." Haskell provides lots of tools for reasoning about and managing side effects; it just doesn't (and, indeed, can't) allow them arbitrarily. In terms of interacting with the outside world—e.g. doing GUI work or interacting with a database—you usually have an effectful 'core' that manages side effects while a slew of pure helper functions operate on the data derived from those side effects. (This is good style in non-functional languages, as well, as it is a kind of separation of concerns.) Other functional languages are far less stringent about side effects, so both the ML family and Scheme allow state modification and side effects, although the functional style is preferred when possible. In terms of writing algorithms, you'd be amazed at how little needs to be expressed in terms of manipulation of state. It feels natural to write stateful functions if you've spent large amounts of time programming in stateful languages, but that has more to do with your familiarity than a property inherent in the problem. If you were immersed in Scheme, you might say, "...a large amount of programming is about function definition and application", just like if you were immersed in Forth, you might say, "...a large amount of programming is about stack manipulation." You certainly could use e.g. Scheme as language for general-purpose programming, and I suspect the problems that would arise would not be problems with functional programming, but rather an unfortunate lack of modern libraries for things like Unicode handling.
- jiggy2011 15y agoI agree that you can vastly reduce state is a large number of cases. It just seems strange to write in a purely functional language when there are many languages out there that combine functional style with the ability to write in an imperative way. I can quite happily write programs in python without any real side effects, indeed as you suggest I usually try and divide my functions between those which have side effects and those which don't. So what advantage would I get for picking haskell instead? Other than marginally shorter programs? FP seems to be picking up steam recently, is this just because we are doing more computation in the cloud and CPUs are getting more cores rather than more raw clock speed or am I missing something?
- nightski 15y ago
- doublec 15y agoI've written public web applications in Ur/Web (a functional language for web development, http://www.impredicative.com/ur/ http://www.impredicative.com/ur/) and the backend for one in ATS (http://www.ats-lang.org http://www.ats-lang.org). I've found them both pretty productive.
- junkyarddog 15y agoOne company that's making heavy use of F# is Credit Suisse. They use it in their global modeling and analysis group. The F# based WebSharper web framework: http://websharper.com/ http://websharper.com/. WebSharper is based on the work of Philip Wadler, et al: http://groups.inf.ed.ac.uk/links/formlets/ http://groups.inf.ed.ac.uk/links/formlets/ Here's another article by Philip Wadler on Formlets: http://homepages.inf.ed.ac.uk/wadler/papers/formlets-aplas/formlets-bcs-facs.pdf http://homepages.inf.ed.ac.uk/wadler/papers/formlets-aplas/f... Of course Microsoft uses F# for Bing data processing.
- rat87 15y agoI think you may argue that some languages are in practice more or less pure by how much they encourage/enable avoiding mutability and side effects but of the 4/5 languages he discusses I'm pretty sure only haskell is purely functional. Scala Scheme and SML/ocaml are all impure functional that allow mutability/side effects. (Scala is considered an object functional hybrid by some and an object oriented language dressed as functional by others - try to avoid flamewar). Some Examples: I think Twitter uses Scala(see above) for a number of their back-end services (see http://blog.redfin.com/devblog/2010/05/how_and_why_twitter_uses_scala.html http://blog.redfin.com/devblog/2010/05/how_and_why_twitter_u...). Foursquare uses scala at least on the front end http://news.ycombinator.com/item?id=1139062 http://news.ycombinator.com/item?id=1139062 . This page has a few other big success http://www.scala-lang.org/node/1658 http://www.scala-lang.org/node/1658. Haskell has pandoc(http://johnmacfarlane.net/pandoc/ http://johnmacfarlane.net/pandoc/) a cmdline tool to convert beetween markup formats(also a library with binding to several languages) I think it supports a wider range of formats/fidelity then alternatives. Ocaml: MLDonkey is an open source eDonkey2000 client Coq – a interactive theorem prover. Ocaml
- SomeOtherGuy 15y ago>I'm not convinced that I would be more productive developing say a web app , database app or game using say Haskell rather than Java or Python Have you tried? Why do you think your baseless assumptions are interesting?