Skip to Content

What language is used to make WhatsApp?

WhatsApp is one of the most widely used messaging applications in the world, with over 2 billion active users. Given its popularity, many people are curious about how WhatsApp works and what technologies are used to build it. One common question is: what programming language is used to develop WhatsApp?

Quick Answer

The primary languages used to develop WhatsApp are Erlang for the backend, Java for the Android app, Objective-C for the iOS app, and React Native for the WhatsApp web app. So in summary:

  • Backend: Erlang
  • Android app: Java
  • iOS app: Objective-C
  • Web app: React Native + JavaScript

Why These Languages Were Chosen

There are specific reasons why WhatsApp uses this combination of programming languages:

  • Erlang – WhatsApp handles billions of messages sent between users daily. Erlang was selected for its strengths in concurrency, distributed computing, and real-time applications. The language makes it easier to scale and ensure smooth functioning despite massive user loads.
  • Java – The Android operating system is based on Java. So native Android apps are commonly built with Java to optimize performance and integration with the OS.
  • Objective-C – This language was traditionally used to build native iOS apps, as it provides easy access to Apple’s Cocoa Touch frameworks.
  • React Native – For WhatsApp’s web/desktop apps, React Native allows building cross-platform apps using JavaScript and React frameworks. This provides more code reuse across platforms.

Backend Development with Erlang

Let’s look more closely at why Erlang is used for WhatsApp’s backend systems.

First created in 1986, Erlang is a lesser-known programming language, but it offers important benefits for real-time applications:

  • Concurrency – Erlang uses a concept called “Actors” which are lightweight concurrent processes. This model makes it easy to scale horizontally across multiple cores and processors.
  • Distributed – Erlang makes it straightforward to distribute a system across multiple servers, enabling seamless scalability.
  • Fault Tolerance – Code is compartmentalized into isolated processes, so that if one process crashes, others can keep going uninterrupted. This provides greater reliability.
  • Hot Swapping – Code can be updated without stopping the system, which allows for better uptime.

For a messaging platform like WhatsApp that needs to support millions of simultaneously connected users, these strengths make Erlang a solid backend choice.

Key Erlang Tools Used

WhatsApp makes use of several Erlang tools and frameworks specifically:

  • Cowboy – A lightweight web server framework used to handle HTTP requests.
  • Mnesia – A distributed database management system built natively in Erlang.
  • ejabberd – An XMPP server used for real-time messaging routing.

Frontend Development

On the frontend, WhatsApp uses different programming languages depending on platform.

Android App (Java)

For Android, Java is the expected choice since it is the primary language for Android development. WhatsApp’s Android app uses common frameworks like:

  • Android SDK
  • Android UI Toolkit
  • Android Notification API
  • Android Media API

These provide access to core Android OS capabilities required for messaging, notifications, media sharing, and more.

iOS App (Objective-C)

Historically, Objective-C was the main language used to build iOS and macOS applications. It provided a thin layer on top of C, while also providing object-oriented capabilities.

WhatsApp’s original iOS app was built with Objective-C and Cocoa Touch. Over time, more Swift code has likely been introduced as well.

Web App (React Native + JavaScript)

In recent years, WhatsApp launched web and desktop versions of its app. These are built using React Native, a cross-platform development framework.

React Native allows building Android, iOS, web, and desktop apps using the same JavaScript codebase. For WhatsApp’s web app, it runs in the browser rather than natively, providing a responsive web experience.

Conclusion

In summary, WhatsApp relies on Erlang for its reliable and scalable backend, Java and Objective-C for native Android and iOS clients, and React Native for web/desktop versions. The combination of these languages provides:

  • Backend scaling with Erlang
  • Native performance on mobile with Java and Objective-C
  • Code reuse across platforms with React Native

This selective use of programming languages optimized for their target environment has enabled WhatsApp to become one of the most widely-used messaging apps globally.