Everyone loves a good statistic, so I’ve put together a small python script that collects the major language used in each released ROS repository, as classified by GitHub. You can clearly see that C++ is the dominant language, but Python is also used a lot, including for “serious stuff”.
Some caveats in the statistics:
- The list only shows the major language used in a repo (winner takes it all). Often, ROS repos contain both C++ and Python (or other) code, but C++ wins by LOC, so smaller languages are underrepresented in the list below.
- I’m only counting repos, but the repos differ in size a lot. Some contain many packages with several 10,000 LOC, some are single-package repos with only a couple dozen LOC.
To answer the question, I wouldn’t say people “graduate” from Python to C++. Personally, I use both, depending on the task. My main criterion isn’t performance, but library support (although the two are linked). If you’re processing a lot of point clouds, you’re probably going to use things like PCL and Octomap, which means C++. For image processing, you’re probably going to use OpenCV, which has bindings both for C++ and Python. Most high-level executive frameworks (such as executive_smach
or one of the behavior tree frameworks) are written in Python. And for small helper nodes, one-off scripts, or anything involving web sockets or REST APIs, I also prefer Python.
Here are the results:
Main languages in ROS repos by popularity
rank | Language | repos | percent |
---|---|---|---|
1. | C++ | 350 | 55.0% |
2. | Python | 158 | 24.8% |
3. | CMake | 82 | 12.9% |
4. | C | 15 | 2.4% |
5. | Common Lisp | 8 | 1.3% |
6. | None | 7 | 1.1% |
7. | Java | 4 | 0.6% |
8. | EmberScript | 3 | 0.5% |
9. | Shell | 2 | 0.3% |
10. | HTML | 2 | 0.3% |
11. | Arduino | 1 | 0.2% |
12. | Emacs Lisp | 1 | 0.2% |
13. | Lua | 1 | 0.2% |
14. | Protocol Buffer | 1 | 0.2% |
15. | C# | 1 | 0.2% |