Embedded Software Programming Languages: Pros, Cons, and Comparisons of Popular Languages

Deciding on the programming language for an embedded system may be the most important building decision you make. I've built thousands of embedded systems, using a range of languages. Here’s my advice on using and picking languages, and tips from other development experts.

In this article:

What is an embedded programming language?

An embedded programming language is a programming language that developers use in embedded systems. In general, the languages offer low-level access to the device hardware. Developers use several common programming languages for embedded systems. 

Some people also call these embedded coding languages. But programming involves much more than coding.  

What programming languages are used in embedded systems?

Developers use a variety of programming languages in embedded systems. The most used languages include C, C++, Python, MicroPython, and Java. 

Popular programming languages for embedded systems

Programming languages that developers frequently use in embedded systems have some key advantages. Most languages also have drawbacks. Here are the advantages and limitations of popular embedded programming languages.

C
  • The basics: Developed in the early 1970s, C is a compiled language that serves as a building block of many other languages.
  • Pros: C is an efficient and widely used programming language. Industry estimates say 80% of embedded systems use the C programming language. 
  • Cons: Requires developers to understand and use technical coding techniques that can be complicated.
C++

  • The basics: This compiled language has most or all elements of C, but also other capabilities. The language was designed in part for system programming and embedded systems.
  • Pros: C++ can be as efficient as using C, but it has a standards library that can save programmers time in writing code.
  • Cons: A complex language that can be difficult to learn.
  • Expert commentary:  "If you look at C++, it has so many capabilities. But there are capabilities in the language that if you don't use a subset of it, you can really destroy performance in an embedded system. So, there's that need to recognize that,” explains Jacob Beningo, Embedded Software Consultant and President of Beningo Embedded Group. “You have all of these features, but it's only a true subset that you can use as an embedded developer. Other features can slow down your code, make it kind of bloated, and just not perform very well.”
Python
  • The basics: Developed in the early 1980's (and named after the British comedy troop Monty Python), Python is a popular programming language. It excels in machine learning, artificial intelligence (AI), and data analytics, but you can use it in many other applications.
  • Pros: The language is open source, free to use, and easy to learn, read, and write. 
  • Cons: This language is not deterministic— not for real-time operating systems (RTOS).
MicroPython

  • The basics: This language is a version of Python optimized for microcontrollers.
  • Pros: MicroPython is also open source, free to use, and easy to learn.
  • Cons: The code isn't as fast and may use more memory compared to C or C++
  • Expert commentary: Beningo says the advantages of MicoPython include "all the libraries, the frameworks, the existing code, and the fact that everybody knows it. It's easy to learn. I've even heard of elementary school students writing Python code." 
Java
  • The basics: Java is an efficient, general-purpose language used extensively for internet-based applications. In embedded systems, Java is best for those running on the Android OS.
  • Pros: Once written in an embedded system, the code is portable to another device and quite reliable.
  • Cons: The language can be complex, leading to performance issues, including those with graphical user interfaces (GUIs). You can’t use Java in real-time systems.
JavaScript
  • The basics: JavaScript is a text-based programming language used in some embedded systems.
  • Pros: A good option if your system is based on HTML5 and requires significant networking and graphics.
  • Cons: Poor runtime efficiency and can be challenging to maintain.
Rust

  • The basics: In 2010, a Mozilla employee developed this high-level programming language designed for performance and safety.
  • Pros: Rust helps encourage secure code with fewer bugs.
  • Cons: Rust takes time to compile. The language isn’t standardized or used much yet.
  • Expert commentary: "Rust is still very new. It will take more time until it really penetrates the embedded market on the system level. But its potential is clear, and it should be on every strategic watchlist,” explains Maurice Kalinowski, Product Director for Qt.

Other languages for embedded systems


Developers also use other languages for embedded systems with specific needs. These languages are not common across all embedded systems but are popular in specific cases and perfect for some systems.

Ada
  • The basics: In the 1970s, Ada was created as a U.S. Department of Defense project due to its concern about the hundreds of programming languages in its embedded systems.
  • Pros: The language is extremely efficient and reliable.
  • Cons: Ada can be challenging to learn and isn’t widely used. 
Assembly
  • The basics: Assembly is a low-level programming language that directly communicates with computer hardware.
  • Pros: The language is memory efficient and fast.
  • Cons: Assembly can be difficult to read and maintain.
Go: Sometimes called Golang, Go is a programming language developed by Google that developers use in some embedded systems.

Comparison matrix for some of the top embedded programming languages

Comparison Matrix of Some of the Top Embedded Programming Languages

 

Download comparison matrix of top embedded software programming languages.

What is a hardware description language?

A couple of languages that some people may refer to as programming languages are actually "hardware description languages," or HDLs. The two primary HDLs are Verilog and VHDL.

HDLs allow engineers to simulate an electronic circuit while the simulation remains independent of that circuit. Engineers use HDLs for design, testing, and debugging of systems and doing timing analysis of systems. 

Comparison of 6 top embedded software programming languages

Qt's Embedded Product Planning and Requirements Guide feature details and a comparison chart on the top five embedded programming languages. The chart compares key traits of the programming languages.

  C C++ Java Python / MicroPython JavaScript/
HTML5/CSS
Rust
Strenghts Embedded, bare-metal,
 IoT
Embedded, bare-metal,
standalone
apps, IoT
Web, cloud Cloud, data science Web Embedded,
bare-metal
Ease of development ★★★ ★★ ★★★ ★★★★★ ★★ ★★★★

Expressive power

★★★★ ★★ ★★★★★ ★★★ ★★★★
Ease of maintenance ★★★★ ★★★★ ★★★★ ★★★ ★★★★
Longevity ★★★★★ ★★★★ ★★★ ★★★
Runtime efficiency ★★★★★ ★★★★★ ★★★ ★★ ★★★★
Library/module availability ★★★★ ★★★★ ★★★ ★★★★ ★★★★ ★★
Low-level interface ★★★★★ ★★★★★ ★★ ★★★ ★★★★
Connectivity support ★★ ★★★/★★★★★¹ ★★★★ ★★★★★ ★★★★★ ★★
Graphics support ★★★★ ★★★★★ ★★★ ★★★ ★★★★★
Developer community

★★★

★★★ ★/★★★★² ★★★★ ★★★★★ ★★

★ is the lowest ranking while ★★★★★ is the highest. 
1 Provides high level of connectivity and networking support when platform libraries included
2 Java Developer community exclusive of Android (low) and inclusive of Android (high)

How to pick the right language for your embedded project

When selecting a programming language for an embedded system, experts say you must understand the strengths and weaknesses of each language. It’s equally important to know the limitations and goals of your system.

For many embedded systems, C or C++ will be the best choices. In part, that’s because they are “compiled” languages and extremely efficient. In compiled languages, the machine (or embedded device) directly translates the code, which means the language is fast and stable.

Devices that have minimal memory or power will often require that efficiency. So, programmers often use C or C++ in those devices. C or C++ are frequently used in microcontrollers and in embedded devices that use real operating systems. Those systems also demand the speed and efficiency that C and C++ provide. You’ll also find C and C++ in several other embedded systems. Some experts estimate that about 80% of all embedded systems use the C programming language.

But your embedded system might also work just as well, or better, with an “interpreted” programming language. With an interpreted language, the embedded device does not directly translate the code. Instead, another interpreter program running on top of the device executes the code. For some embedded systems, the advantages of interpreted languages will be critical. Unlike compiled languages, interpreted languages are easily portable from one OS to another. They are also much easier for programmers to learn, read and write.

Python and JavaScript are examples of interpreted programming languages. Since interpreted languages require extra processing, they often operate more slowly than compiled languages — though their speed is improving. If your embedded device uses machine learning, Python and MicroPython have significant advantages. 

Ada is a programming language you may want to use if your device requires extraordinary security and stability (as in medical devices or aviation or military equipment). 

Experts also state that you must realize the capabilities and experience of your programming team. "I always tell people to look at the skill set of their engineers," adds Beningo. "I try to push a lot of people to use C+ now if they can. But for engineers that know C well, the transition to C++ can sometimes be difficult. So, it's really looking at the experience and the skill sets of the team that helps dictate that." (Learn more about skills that embedded engineers need.)

And Burkhard Stubert, an independent software developer and consultant specializing in embedded systems, explains that companies often don't have much choice in the programming language they use. The existing system or related systems may be using a programming language that means they’ll need to use a specific language.

"Normally, you don’t pick the language, but the language picks you," Stubert shares. "With embedded systems, this is typically C, C++, or Python. Then, you go from there."

Finding the language that works best for your embedded system

Every embedded programming language has its pros and cons. Some languages work better than others with graphical user interfaces. Just as you spend time researching the language you want to use, you’ll also want to consider the GUI when you pick the language. For example, if your system uses GUIs, you likely will want to use an interpreted language like JavaScript.

Create your embedded system using your favorite programming language with Qt

Sometimes, there is a clear-cut way to tell which language best suits the needs of your embedded project. Quite often, the choice comes down to what the developers are proficient with and personal preferences. Qt aims to give you the freedom to create software in the programming language you like best. The Qt Company supports C++, QML (Qt's easy-to-use declarative language), and Python, while even more languages like Rust and Go are backed by the community.  

Learn more about designing your system's user interfaces with Qt QML and how to use other Qt products to build the best embedded system in a range of languages.