by ryandvm · 11y ago · 0 comments
The biggest FP project I was aware of was Twitter using Scala and they ended up completely backing away from it. Yikes.
The only other popular site that springs to mind is Hacker News, and frankly, it sucks. It's practically the Hello World of discussion forums.
The truth is, at the end of the day almost everything is being built with Java, Python, Ruby, or JavaScript. Can you really blame the product owners for being wary of writing their whole product in a functional language?
How about Erlang. Let's try it, just from the top of my head:
* AXD 301 Switch -- Classic. Powers and control phone switch networks of whole countries. Claims 99.9999999% reliability.
* Basho Riak -- popular NoSQL database, highly scalable nodes are peers
* RabbitMQ -- popular message queue used by enterprises
* WhatsApp -- messaging application, processes billions of messages a day. Built and maintained by only a few engineers. Sold for billions of dollars.
* Klarna -- European payment processing
* Bet365 -- Sports bets
* Stock trading -- Allegedly Goldman Sachs uses it.
* Erlyvideo.org -- Video streaming service
* eNodeB -- Ericsson cell to internet gateway. There is a 50% if you want to look at cat pictures from your smartphone and Erlang breaks, you won't see your cat pictures.
* Wings3D -- A subdivision 3D modeler. I guess you can build your 3D cat and then send it over WhatsApp via a eNodeB to your friend.
Those are just I know of. So there you go. Maybe you should learn Erlang ;-)
Erlang isn' purely functional language in the same sense as Haskell is. It's much more mainstream compared to it.
Clojure has even less of it. It's basically LISP which is about 60 years old.
But you make an interesting point in a way. One can ask, ok here are two non-strictly functional languages that seem to be fairly practical. Used for large distributed mission critical systems.
Would they be better off written in Haskell?
Would they have been written at all if creators only knew about Haskell?
How large is the relationship between fault tolerant and safe systems as a product vs strong compiler type safety in the language it was written.
I think there're at least these problems with Haskell:
* The language is badly designed. See the number of extensions which aren't standardized but widely used. See also obvious problems such as requirement to use renames when importing code, and problem with record names conflicts which isn't solved for years.
* The focus of the language isn't correct. Lazy evaluations creates a lot of problems both in program performance and complexity of the compiler. The most important parts are pureness and side effect control.
* The language is already obsolete. Many its constructions and related complexities are redundant if we unify type and expression level, and get as a result dependently typed system.
I hope some language in the future will implement these ideas, and we will have a widely used pure functional dependently typed language with explicit control of effects.
I see two candidates for such a language:
* Pure script - it's Haskell done right, compiledd to JS. Unfortunately, it doesn't support dependent types.
* Idris - it's the language which I describe, but I fear that it's impossible to create a widely used commercial language without major industry players' support.
First, you need to be persistently connected so that you don't miss messages when you're not actually at your computer.
Second, you need a decent interface to use when you are actively reading or chatting.
Third, it would be great to have the same across all devices (phone, tablet, laptop/desktop), with everything syncing correctly. If you read some scrollback on your phone, you want your laptop to also know that you already read those messages, and vice versa.
It's certainly possible to achieve all this with irssi and a combination of other techniques. However, you can also use something like IRCCloud and get every problem solved at a very high level of competence immediately, plus a bunch of other stuff (like push notifications and embedded social media, images, videos, tweets, pastebins, etc.).
It's up to you. For me, I really just want everything to work and I don't care at all about doing it myself. It's a means to an end. The $5/month fee is not important to me given the product quality. I sort of liken it to Dropbox -- it's not about doing something that couldn't be done before, it's about just making it streamlined for those who don't care to do it themselves.
Allegedly, Goldman also uses Excel spreadsheet macros. I wouldn't use the Goldman one.
As for Hacker News UX I wish every site was this simple instead of popups everywhere to get me to download their phone app, piles of slow loading fonts, trackers, generic stock images of business suits pointing at a screen, information buried underneath annoying popup FAQ screens, ect.
Disclosure: I help look after about 5 million lines of code for one of the encumbents...
You need to normalize against the number of programmers writing in Java/Python/... compared to the number of programmers writing Haskell for this assertion to be meaningful. And when you do that, the picture starts to look a lot better.
In the past few years I have seen more and more people start writing real projects in Haskell and be successful. There was a presentation a couple years ago at CUFP [1] discussing one company's experience porting a 43k line Groovy app to 8200 lines of Haskell. You don't need someone to build a highly visible multi-million line piece of software in Haskell to be confident that it can benefit your project. I think there's enough evidence out there today to make a very compelling case.
Now what percentage of the non-functional ones ends up becoming successful enough for you to hear about them and know what they were built with? Apply that percentage to the functional projects, you might just be left with naught.
I have a feeling that if there's one thing more rare than functional programs, it's highly successful ones.
However, to be productive, you're usually constrained by what the dominant language is for your domain. For example, Android apps are usually written in Java and web apps are usually written in JavaScript. Each has a huge ecosystem of tools and libraries based around these languages.
I'm sure there's some way I could use Haskell or OCaml to write Android and web apps. However, by going against the grain, it's likely to be very time consuming and frustrating to integrate with existing libraries and tools. I'm therefore going to lose any advantage I was hoping to gain from using a functional language.
I don't know about Android, but for Javascript apps the balance tipped for me just last month. I'm probably enough of an insider that it's not quite true yet for the average Haskell developer, but I believe that will change soon.
For the code running on the server side, you are free to use whatever you want. Are you using strongly typed FP there?
What are you talking about, I just searched and found zero supporting sources
https://www.redfin.com/devblog/2010/05/how_and_why_twitter_u...
http://readwrite.com/2011/07/06/twitter-java-scala
http://www.slideshare.net/al3x/the-how-and-why-of-scala-at-t...
That said, you do have a valid point: The presentation provides justifications for those that want to switch in the first place, but to be compelling, it needs evidence.
You must be joking, Twitter is far and away the largest Scala shop in the world.
Presumably you're mixing up LinkedIn's recent move from Scala to Java. An important caveat is that they're still using the Play framework (Typesafe product), just now in Java instead of Scala.
It's unfortunate that Play serves two masters (i.e. Scala and Java), but industry demands it -- the argument that FP is the one true way goes out the window in face of current reality: enterprise by and large will go with mature tooling and cheap developers in a large-team-friendly language like Java over a paradigm shifting FP language like Scala, Clojure, or Haskell.
Looks like it is mostly used for compilers, cryptography, and risk assessment.
Whitepages is also Scala.
That's off the immediate top of my head.
Turing completeness ensures there's no "true way", but some languages offer better abstractions than others. In my experience, once you learn the abstractions, the functional paradigm has an edge about the ability to reason about the code.
Of course, the adoption of new ideas and technologies takes time, they need to be explored and fully developed. But even right now, you see many mainstream languages adopting functional flavors.
I believe that eventually, there will be enough successful large scale projects build with pure functional languages to convince skeptics, there's nothing wrong with "playing it safe" and wait.
If Scala is good enough as an example, I see an increasing adoption. As an anecdote, one of the biggest and Very Serious(tm) investment bank, is using Scala for most of their new initiatives, with a big team spread across the world. And the language itself was selected by a committee. You can't get more serious than that...
You mean .NET, PHP, and Java?[0]
[0] - http://trends.builtwith.com/framework
ps - For the record, I'm a rails/js guy
http://www.quora.com/Reviews-of-Functional-Programming-in-Sc...
> The reason, I'm hesitant to give it a fifth star is ultimately that I don't believe that Scala is a good language in which to actually do functional programming.
Literally the only other mainstream language that he would be able to say is capable of "fp" better than Scala would be Haskell.
You only need to have one look at it's module system/Cabal/Hackage to see that it was never intended for larger code bases than people's PhD thesis.
Yes, it can scale: In the same way PHP and JavaScript does.
Standard Chartered has a huge amount of infrastructure in Haskell. Clojure's too young to have the types of stories you're looking for, but it's had plenty of moderate-sized successes (as has Haskell).
The biggest FP project I was aware of was Twitter using Scala and they ended up completely backing away from it. Yikes.
Scala is different from Haskell. Scala has a lot of features that don't play well together, it has stability issues, and it has inherited some of the Java culture which means that there's a lot of terrible Scala code out there.
I've been working with Spark over the past month and I'm shocked by how bad the JVM/Hadoop legacy is. Spark itself is a neat idea. Getting it to work on an actual production cluster is a huge PITA. I'm tempted to just use Cloud Haskell.
I know people who've moved away from Scala (either to Java or Clojure or Haskell). No one who's moved to Haskell has ever regretted it. I know of about 15 companies that use it (not all on million-line projects) and they're all happy with it. I'm only aware of one case, in the past 7 years, where a company moved away from using Haskell: they moved to F# because they picked Microsoft up as a client and MSFT wanted to be able to say that $COMPANY_X was using their products.
The only other popular site that springs to mind is Hacker News, and frankly, it sucks. It's practically the Hello World of discussion forums.
It's written in Arc, which lost to Clojure. Also, HN is as good as it needs to be. It's successful on its own terms. It doesn't need to be a wonder of software engineering.
It will be once it gets a decent mobile view akin to viewing reddit on /.compact.
Anyway, good point--I've heard people complain that Haskell is hard to learn/understand, but I've never heard of anyone actually using it in production and regretting that decision.