Recently a company called Modular created a programming language called Mojo (Mojo 🔥: Programming language for all of AI) which essentially does to Python what Typescript does to Javascript. Has anyone experimented with using Mojo for ROS development? What is your experience?
I’m curious to see if Mojo can overcome some of the performance hurdles that is dissuading a lot of companies from using Python in robotics applications.
I don’t think Python is being rejected by any significant number of robotics companies. Anyone trying to decide which language(s) to use for their application would choose the most appropriate language for each component. For example, C++ or pure C or Rust for high-performance code, and Python for components where performance is less important than lower implementation and maintenance costs. ROS makes this particularly easy to achieve, as do things like web APIs.
I also think that Mojo is going to have trouble becoming that popular when it’s not open source, the “free” version has an ambiguously restrictive license (you are not allowed to use it commercially for anything that Modular decides is a “competitive activity”), and there are completely free and open-source languages available that provide the same performance and can be used where performance is needed.
From Mojo’s website: “We plan to progressively make the source code of Mojo fully available in the future”
Mojo is still a pretty new language and the developers want to make sure a good chuck of the bells & whistles are properly functioning before a release.
In ROS, When Mojo is mature, I see it being used in performance critical domains like AI/ML, where C++/C/CUDA/Rust might fall short due to language complexity, although Rust is a pretty nice high level performance critical language already. There are also various benefits from Mojo’s use of MLIR (such as better SIMD and portability).
Yes, mojo’s installation process needs a user to login, which is quite different from other compilers like gcc or clang.
Except for that, I think mojo is a perfect match for ROS. Currently c++ and python are used in ROS, for both of the 2 languages,
c++: will still dominant this industry but more and more new code is written purposely not in c++ (mostly in rust). I see a good opportunity like rclmojo to join the rewrite-everything-in-rust party.
python: easy to use but can’t go serious because it’s slow. the rqt tools is an example, it is very slow when monitoring ros topics.
mojo is a fix to both of the 2 problems, in my opinion.