Hello everyone and welcome back to the Cognixia podcast. Every week, we get together to talk about the latest happenings, bust some myths, discuss new concepts, and a lot more from the world of digital emerging technologies. From cloud computing to DevOps, containers to ChatGPT, and Project management to IT service management, we cover a little bit of everything week after week, to inspire our listeners to learn something new, sharpen their skills, and move ahead in their careers.
This week, we are going to talk about a new programming language that is becoming incredibly popular among AI developers, the language is a perfect fit for working with artificial intelligence, it is very simple and user-friendly like Python, and it is as quick as Rust, and has the performance and control like C++. Now, let’s take a second to just appreciate how awesome that is! (Take a second to pause)
This is the Mojo language. Mojo achieves high performance through innovative compiler technologies like integrated caching, multi-threading, cloud distribution, etc. It also includes auto-tuning and meta-programming which enables code optimization for various hardware.
Let us look at some of the key features of the Mojo language:
First, Mojo has a Python-like syntax and dynamic typing ability which makes the Mojo language very easy to learn if you are already familiar with Python. When you are working with modern developments in artificial intelligence and machine learning, then knowing Python is inevitable and with those skills, you can easily work with Mojo too.
Second, you can import and use any of the Python libraries in Mojo, easily. Mojo has complete interoperability with Python, so you won’t have to keep wondering how easy your task would be if only you had access to the matplotlib library, just import it into Mojo and get working!
Third, Mojo follows a very easy unified programming model that is super beginner-friendly and highly scalable for a wide range of use cases based on accelerators. It accomplishes this by combining dynamic and systems language capabilities.
Fourth, the Mojo compiler applies advanced optimizations and GPU/TPU code generation, thereby supporting both Just-in-Time compilation as well as Ahead-of-Time compilation.
Fifth, there are zero cost abstractions, so you can take control of the storage by inline-allocating values into the structures.
Sixth, Mojo offers language-integrated auto-tuning, which enables you to automatically find the best values for your parameters to make the most of your target hardware.
Seventh, you can very easily extend your models with pre- as well as post-processing operations, and you can even replace the operations with custom operations, taking full advantage of kernel fusion, graph rewrites, shape functions, etc.
Finally, the Mojo language gives the user full control over the memory layout, concurrency, and other low-level details.
If you have heard the episode carefully so far, we are sure by now you can’t wait to power up your laptop and get started working using the Mojo language, right? However, we have some bad news for you. The language is still incomplete and not yet publicly available. Not what you were expecting, is it? The Mojo documentation currently targets developers with systems programming experience. But, you can still access the Mojo Playground by signing up for Modular Products, just make sure you select the option to use Mojo in Modular Product Interest.
What is Modular, you ask? Modular is a fully integrated, composable suite of artificial intelligence infrastructure tools with unmatched industry performance that streamlines AI workflows. This is what the Modular website states.
Once you sign up, in about an hour, you should have an email that grants you access to the Mojo Playground. We would also like to mention here that the Mojo Playground is a Jupyter Hub environment where the users will be able to the same Mojo standard library. It gives users a private volume to write and save their Mojo programs. Once the Mojo language becomes publicly available and open-source, users will be able to run a Mojo program from a terminal.
Here, we have some interesting trivia for you. Did you know who created the Mojo language? The Mojo language was created by Chris Latner, the same Chris Latner who created the SWIFT programming language as well as the LLVM Compiler Infrastructure.
In some ways, Mojo can be a superset of Python since you do not need to learn Mojo from scratch if you know Python. However, there are some differences between Mojo and Python too. For instance, Mojo Lang has a built-in struct keyword that is quite like a class in Python. However, a struct would be static while a class is a dynamic entity. Inside this struct, Mojo Lang has keywords like var, which is mutable. There is another keyword in it called let, which is immutable. In the same way def is used in Python to define a function, whereas in Mojo lang, def is replaced by fn, which is a much stricter function, relatively speaking. Mojo would also include Single Instruction Multiple Data or SIMD which is a built-in type representing a vector involving a single instruction that can be executed across multiple elements, in tandem with the underlying hardware. The built-in parallelize function in Mojo lang is also unique as it makes the user’s code multi-threaded, helping one increase their speed by about 2000x. Python does not have parallel processing abilities yet. There is also a built-in optimization tool in Mojo Lang that allows users to cache and reuse the data very efficiently and effectively. Additionally, Mojo Lang allows users to autotune their code enabling them to automatically identify the optimum parameters for the target hardware.
We are super excited to get a chance to take Mojo Lang for a spin and can’t wait for it to be launched for the public and become open source, it should be a very exciting development for AI developers and professionals working in the artificial intelligence and machine learning space in general.
With that, we come to the end of this week’s episode of the Cognixia podcast. While we keep an eye on Mojo Lang’s release, we would suggest you check out our range of live online instructor-led courses on our website – www.cognixia.com. We have some very interesting promotions going on right now, and if you have any questions, you can connect with us directly over the chat function there, our team will help you out.
We will be back next week with another interesting and insightful episode of the Cognixia podcast. Till then, keep learning, keep sharing, and stay ahead!
Until next week then, happy learning!