So a lot of you might be wondering what has Instagram been programmed in, or what is the front-end language Facebook uses for their mobile site versus their actual website. These kind of questions might be making you lead in a different question of what program should I learn?! Well I am here to share that with you!
Most of the backend services are written in C (programming language), C++ and Java. A lot of the C++ services rely on Boost. Many of the internal tools and some glue code is written in Python (programming language). One of the services that underlies Chat, the channel servers (see http://www.facebook.com/note.php... ), is written in Erlang (programming language). The backend services and the web frontend communicate using Apache Thrift. The iPhone app and iOS SDK are written in Objective-C (programming language).
OCaml (programming language), Haskell (programming language), and Ruby (programming language) are used internally, but as far as I know they don't power anything available on the website.
Implementing a backend involves knowing a lot about many domains of software engineering: web servers, system adminning, database programming, database tuning, data object transmission formats, load balancing, interfacing with 3rd party APIs, interfacing with 3rd party cloud platforms, etc.
If you are asking this question, you are not ready to think about doing this. Given this, I'd suggest learning how to write the client part of it that runs on the mobile device, which you would do in Objective C/Swift for iOS or Java for Android, and then using a BaaS (Backend as a service) for the backend, such as Kinvey or Parse.
Twitter was originally built as a Ruby on Rails app. Over time, we have slowly been moving away from that and most services within Twitter are either close to or completely done with the transition. However, there are still a few services that are using ruby extensively.
Of the services that have moved away from rails, almost all are using Scala though there is some use of plain Java. I've heard talk of using C++ in places where performance is extremely important but I'm not sure if that's been implemented in production yet.
Java and Objective-C are, of course, used by the Android and iOS teams, respectively. I don't work on the iOS team and I haven't looked at their code base so I can't comment on whether or not there has been anyone looking into moving to Swift.
On the internal tools side, Python has become much more common, though there are still lots tools and testing frameworks written in Ruby, and, of course, there's lots of bash scripts.
We originally had a monolithic Python backend, and even in our shift to a services-oriented architecture, we kept to Python for a while — for a variety of reasons, including: existing familiarity of the dev team with Python and with Python in our stack; the ease of just extracting portions of our codebase and wrapping them in thin Python service layers rather than implementing those services from scratch; and of course all the usual reasons that Python is a good language for startups to move fast and iterate with.
Search was the first major piece of our backend written in Java, and as our engineering stack has matured and we've upped our bar for availability, performance, and reliability, we've turned to Java for a lot of other services as well, particularly in infrastructure. We recently introduced Go as part of our ads serving stack and Go is also now a supported language in our services framework.
C++, Java, and Python are the most prevalent.
C++ generally powers compute-intensive back-end services, Java (and a wealth of libraries including servlets, Guice, and Guava) is often used for application logic, and many scripts are written in Python. Parts of YouTube are written in Python as well as some App Engine applications.
Some less dominant languages include:
Sawzall, for processing log files.
Go (programming language), for highly concurrent systems. Nowhere near as popular as C++ but that may very well change in a few years.
Several small DSLs used for monitoring, builds, and deployment.
Perl, PHP, and Ruby are occasionally used for small scripts and web pages but not so much for production sites. Also see Neil Kandalgaonkar's answer to When will Google permit languages other than Python, C++, Java and Go to be used for internal projects?. He brings up some interesting points like readability reviews and how they affect language choice.