Hello everyone and welcome back to the Cognixia podcast. Every week, we dig up a new topic from emerging digital technologies and share insights, ideas, information, stories, and more. We strive to inspire our listeners to learn new things and update their repertoire of skills to stay relevant and continue growing in their careers.
Earlier in 2024, Modular, the company that owns the Mojo programming language raised a $100 million funding. Mojo has powerful, easy-to-use features combining Python’s expressiveness and C’s performance. With Mojo’s unique features and great experience, it has been a long-standing question whether Mojo will replace Python in the future. Now that Modular has secured the funding, the question has surfaced again and Reddit forums are buzzing with users and developers sharing their thoughts. Will Mojo become the king of programming languages – a title that Python has held for many years? Should aspiring developers focus more on and prioritize learning Mojo than learning Python? This is what we will discuss in today’s episode.
According to the Modular, one could Python or scale down to the metal with Mojo. Mojo could help program a multitude of low-level AI hardware. Programming languages can often be very complex and confusing. Python broke the mold and made programming like talking in English. Mojo understood the need for a programming language that is not just easy to use but also supports & offers features not found in other languages like adaptive compilation strategies, caching during the compilation process, and strong compile-time metaprogramming. With time, Mojo became so popular that it is now touted to have the potential to take over AI development.
Mojo is often regarded, even by its developers, as a superset of Python. Mojo builds on the convenience and ease of Python, making it more versatile and quicker. Millions of programmers and coders are already fluent in Python and they understand the capabilities and limitations of Python very well. So, offering something that builds on a language they are fluent in, adding some additional cool capabilities, and plugging in some limitations works well for Mojo. Additionally, the cherry on the cake is, that Mojo leverages the entire, vast ecosystem of libraries that Python offers. One of the most valuable features of Python is its extensive libraries, after all. Mojo is built on a new codebase and it offers users the high computational ability of C and C++. Bringing the best of all worlds, isn’t it?
In that case, shouldn’t everybody just ditch Python and move to Mojo? Well, not really. User-friendliness and flexibility are the two key advantages of Python but its speed and performance sometimes work against it. This is why programmers often must rewrite Python prototypes in C++ or Rust to get good efficiency going. However, this becomes quite a bottleneck when developing for AI. After investing in Python codebases if one has to rewrite the code, it can be annoying, time-consuming, and expensive. Efficiency can take a hit, especially in the inner loops of code, where efficiency is absolutely essential. Moreover, using two languages creates a problem of hybrid libraries which makes debugging the code extremely difficult. The larger the frames get, the more complicated this problem becomes. When you add AI to the mix, the two-language problem now becomes a three-world problem.
This is one major area where Mojo scores the win. When you need high-performing code for modern hardware, choosing Mojo instead of Python might be a good idea. This is critical for AI. AI has a restricted scope for programming system innovation. Programming languages in AI are often confined to specific hardware and there isn’t a language yet that is compatible with all the hardware for AI out there. This further fragments the programming methods available.
Interestingly, when you dig deeper, Mojo is not a threat to Python. Instead, it is the superhero version of Python with some unique superpowers. Mojo is, in a way, a bigger threat to C++. The co-founder of Modular – Chris Lattner shared on X that if anyone should be scared, it should be C++ and hard-to-use accelerator languages. He says that Python is what developers love. C++ is mostly a pragmatic necessary evil for when you need performance. C++, after all, is not mostly a language one thinks of when considering languages for AI development. The way the positioning has been done, Mojo is showcased more as a subset of Python than as a threat. Maybe what AI development needs is a paradigm shift to a unique combination of Python’s AI dominance and Mojo’s incredible performance.
How things will play out, only time will tell. If you are an aspiring programmer or a current one and are planning to diversify the programming languages you know, we would recommend not choosing between Python and Mojo but learning both. Knowing both significantly strengthens your profile for AI development careers. These are interesting times we live in! AI has a long way to go and the potential to offer so much to the world, we have barely scratched the surface. And, one thing is for certain, there will be a demand for programming languages that keep up with the evolving demands of AI development. For now, Mojo and Python are working well for the need at hand.
With that, we come to the end of this week’s episode of the Cognixia podcast. We will be back again next week with another interesting and exciting new episode. Meanwhile, maybe, learn a little bit of Python and a little bit of Mojo, instead of choosing one of the two?
Until then, happy learning!