Mojo New programming language

Mojo is a programming language that is as easy to use as Python but with the performance of C++ and Rust. Furthermore, Mojo provides the ability to leverage the entire Python library ecosystem.

Mojo achieves this feat by utilizing next-generation compiler technologies with integrated caching, multithreading, and cloud distribution technologies. Furthermore, Mojo’s autotuning and compile-time meta-programming features allow you to write code that is portable to even the most exotic hardware.

Why is it called Mojo?

Mojo means “a magical charm” or “magical powers.” We thought this was a fitting name for a language that brings magical powers to Python, including unlocking an innovative programming model for accelerators and other heterogeneous systems pervasive in AI today.

Why Mojo

When we started Modular, we had no intentions of building a new programming language. But as we were building our platform with the intent to unify the world’s ML/AI infrastructure, we realized that programming across the entire stack was too complicated. Plus, we were writing a lot of MLIR by hand and not having a good time

 

Try Mojo

The Mojo language is still very young, but we want your feedback!

The Mojo standard library, compiler, and runtime are not available for local development yet, so we created a hosted development environment where you can try it out. We call it the Mojo Playground!

 

Get started

  1. Sign up for access to the Mojo Playground.
  2. When you receive access, log in to the Mojo Playground using the email address you provided in the above form.
  3. Chat with us on Discord, report issues on GitHub, and feel free to share your Mojo code with others.

Using the Mojo compiler

You can run a Mojo program from a terminal just like you can with Python. So if you have a file named hello.mojo (or hello.—yes, the file extension can be an emoji!), just type mojo hello.mojo:

 

def your_function(a, b):
    let c = a
    # Uncomment to see an error:
    # c = b  # error: c is immutable

    if c != b:
        let d = b
        print(d)

your_function(2, 3)