Mojo: a step change in programming languages
Reader, the title is not hyperbole.
In a previous blog post, I expressed my love for Python and declared it as a language of choice for most projects. I addressed the issue of Python being considered an inefficient language for large projects by mentioning the rise of Python interfaces to packages written in Rust or C, as well as efforts to improve the efficiency of CPython by up to 80%.
However, I did not touch on the challenges of parallel computing and machine learning in Python. While extensions or complements such as PyTorch and CUDA can provide solutions, compatibility issues can be a significant hurdle. But what if there was a way to get C-level performance and multiprocessing with Pythonic interfaces and no extra dependencies? That sounds too good to be true, right?
Introducing Mojo, a new language that promises exactly that. Here's a short (incomplete) list of the language's key features:
1. Bare metal computer access to deliver C-like performance
2. A strict superset of Python, ensuring compatibility and ease of transition
3. Native implementation of parallel processing primitives
4. An "expert" mode for tighter control over data types and implementation to maximize performance
5. Optional static typing
6. Hardware-agnostic implementation for all algorithms
For a more complete list of features, check out the Mojo Docs. Jeremy Howard of fast.ai also has an excellent write-up of the language on the fast.ai blog.
Currently, Mojo is still a work in progress and the only way to try it is in a web playground. I hope the initial excitement translates into further development, eventually leading to a more complete language and compiler. Regardless, Mojo represents a significant step forward by demonstrating that a language as user-friendly as Python but as efficient as C is indeed an achievable goal.