The expressiveness of Python, 
with the performance of C

Mojo installs as part of MAX

  • 175k

    Mojo Developers

  • 23k

    Stars on Github

  • 22k

    Community members

Mojo has powerful & easy to use features

Leverage types for better performance and error checking.

awesome.🔥
def sort(v: ArraySlice[Int]):
  for i in range(len(v)):
    for j in range(len(v) - i - 1):
      if v[j] > v[j + 1]:
        swap(v[j], v[j + 1])
struct MyPair:
  var first: Int
  var second: F32
  
  def __init__(self, first: Int, second: F32):
    self.first = first
    self.second = second
def reorder_and_process(owned x: HugeArray):
  sort(x)	# Update in place
  
  give_away(x^)	# Transfer ownership
  
  print(x[0])	# Error: ‘x’ moved away!
def exp[dt: DType, elts: Int]
    (x: SIMD[dt, elts]) -> SIMD[dt, elts]:
  x = clamp(x, -88.3762626647, 88.37626266)
  k = floor(x * INV_LN2 + 0.5)
  r = k * NEG_LN2 + x
  return ldexp(_exp_taylor(r), k)
def exp_buffer[dt: DType](data: ArraySlice[dt]):

  # Search for the best vector length
  alias vector_len = autotune(1, 4, 8, 16, 32)
  
  # Use it as the vectorization length
  vectorize[exp[dt, vector_len]](data)
file_name.🔥
def sort(v: ArraySlice[Int]):
  for i in range(len(v)):
    for j in range(len(v) - i - 1):
      if v[j] > v[j + 1]:
        swap(v[j], v[j + 1])
struct MyPair:
  var first: Int
  var second: F32
  
  def __init__(self, first: Int, second: F32):
    self.first = first
    self.second = second
def reorder_and_process(owned x: HugeArray):
  sort(x)	# Update in place
  
  give_away(x^)	# Transfer ownership
  
  print(x[0])	# Error: ‘x’ moved away!
def exp[dt: DType, elts: Int]
    (x: SIMD[dt, elts]) -> SIMD[dt, elts]:
  x = clamp(x, -88.3762626647, 88.37626266)
  k = floor(x * INV_LN2 + 0.5)
  r = k * NEG_LN2 + x
  return ldexp(_exp_taylor(r), k)
def exp_buffer[dt: DType](data: ArraySlice[dt]):

  # Search for the best vector length
  alias vector_len = autotune(1, 4, 8, 16, 32)
  
  # Use it as the vectorization length
  vectorize[exp[dt, vector_len]](data)
  • Progressive types

  • Zero cost abstractions

  • Ownership + borrow checker

  • Portable parametric algorithms

  • Language integrated auto-tuning

Mojo fEATURES:

Progressive types

Zero cost abstractions

Ownership + borrow checker

Portable parametric algorithms

Language integrated auto-tuning

Extend Python or scale all the way down to the metal. Program the multitude of low-level A1 hardware. No C++ or CUDA required.

Developers love Mojo 🔥

“I'm excited, you're excited, everyone is excited to see what's new in Mojo and MAX and the amazing achievements of the team at Modular.”

Eprahim

“Max installation on Mac M2 and running llama3 in (q6_k and q4_k) was a breeze! Thank you Modular team!”

NL

“Mojo destroys Python in speed. 12x faster without even trying. The future is bright!”

svpino

“Tired of the two language problem. I have one foot in the ML world and one foot in the geospatial world, and both struggle with the "two-language" problem. Having Mojo - as one language all the way through is be awesome.”

fnands

"C is known for being as fast as assembly, but when we implemented the same logic on Mojo and used some of the out-of-the-box features, it showed a huge increase in performance... It was amazing."

Aydyn

“It’s fast which is awesome. And it’s easy. It’s not CUDA programming...easy to optimize.”

dorjeduck

“I'm excited, you're excited, everyone is excited to see what's new in Mojo and MAX and the amazing achievements of the team at Modular.”

Eprahim

“Max installation on Mac M2 and running llama3 in (q6_k and q4_k) was a breeze! Thank you Modular team!”

NL

“Mojo destroys Python in speed. 12x faster without even trying. The future is bright!”

svpino

“Tired of the two language problem. I have one foot in the ML world and one foot in the geospatial world, and both struggle with the "two-language" problem. Having Mojo - as one language all the way through is be awesome.”

fnands

"C is known for being as fast as assembly, but when we implemented the same logic on Mojo and used some of the out-of-the-box features, it showed a huge increase in performance... It was amazing."

Aydyn

“It’s fast which is awesome. And it’s easy. It’s not CUDA programming...easy to optimize.”

dorjeduck

“I'm excited, you're excited, everyone is excited to see what's new in Mojo and MAX and the amazing achievements of the team at Modular.”

Eprahim

“Max installation on Mac M2 and running llama3 in (q6_k and q4_k) was a breeze! Thank you Modular team!”

NL

“Mojo destroys Python in speed. 12x faster without even trying. The future is bright!”

svpino

“Tired of the two language problem. I have one foot in the ML world and one foot in the geospatial world, and both struggle with the "two-language" problem. Having Mojo - as one language all the way through is be awesome.”

fnands

"C is known for being as fast as assembly, but when we implemented the same logic on Mojo and used some of the out-of-the-box features, it showed a huge increase in performance... It was amazing."

Aydyn

“It’s fast which is awesome. And it’s easy. It’s not CUDA programming...easy to optimize.”

dorjeduck

“I'm excited, you're excited, everyone is excited to see what's new in Mojo and MAX and the amazing achievements of the team at Modular.”

Eprahim

“Max installation on Mac M2 and running llama3 in (q6_k and q4_k) was a breeze! Thank you Modular team!”

NL

“Mojo destroys Python in speed. 12x faster without even trying. The future is bright!”

svpino

“Tired of the two language problem. I have one foot in the ML world and one foot in the geospatial world, and both struggle with the "two-language" problem. Having Mojo - as one language all the way through is be awesome.”

fnands

"C is known for being as fast as assembly, but when we implemented the same logic on Mojo and used some of the out-of-the-box features, it showed a huge increase in performance... It was amazing."

Aydyn

“It’s fast which is awesome. And it’s easy. It’s not CUDA programming...easy to optimize.”

dorjeduck

Mojo destroys Python in speed. 12x faster without even trying. The future is bright!

mytechnotalent

“The Community is incredible and so supportive. It’s awesome to be part of.”

benny.n

“A few weeks ago, I started learning Mojo 🔥 and MAX. Mojo has the potential to take over AI development. It's Python++. Simple to learn, and extremely fast.”

svpino

“What @modular is doing with Mojo and the MaxPlatform is a completely different ballgame.”

scrumtuous

"Mojo gives me the feeling of superpowers. I did not expect it to outperform a well-known solution like llama.cpp."

Aydyn

“Mojo and the MAX Graph API are the surest bet for longterm multi-arch future-substrate NN compilation”

“I am focusing my time to help advance @Modular. I may be starting from scratch but I feel it’s what I need to do to contribute to #AI for the next generation.”

mytechnotalent

“What @modular is doing with Mojo and the MaxPlatform is a completely different ballgame.”

scrumtuous

“Mojo and the MAX Graph API are the surest bet for longterm multi-arch future-substrate NN compilation”

pagilgukey

“I'm very excited to see this coming together and what it represents, not just for MAX, but my hope for what it could also mean for the broader ecosystem that mojo could interact with.”

strangemonad

“I am focusing my time to help advance @Modular. I may be starting from scratch but I feel it’s what I need to do to contribute to #AI for the next generation.”

mytechnotalent

“What @modular is doing with Mojo and the MaxPlatform is a completely different ballgame.”

scrumtuous

“Mojo and the MAX Graph API are the surest bet for longterm multi-arch future-substrate NN compilation”

pagilgukey

“I'm very excited to see this coming together and what it represents, not just for MAX, but my hope for what it could also mean for the broader ecosystem that mojo could interact with.”

strangemonad

“I am focusing my time to help advance @Modular. I may be starting from scratch but I feel it’s what I need to do to contribute to #AI for the next generation.”

mytechnotalent

“What @modular is doing with Mojo and the MaxPlatform is a completely different ballgame.”

scrumtuous

“Mojo and the MAX Graph API are the surest bet for longterm multi-arch future-substrate NN compilation”

pagilgukey

“I'm very excited to see this coming together and what it represents, not just for MAX, but my hope for what it could also mean for the broader ecosystem that mojo could interact with.”

strangemonad

Unlock Python performance

Utilize the full power of the hardware, including multiple cores, vector units, and exotic accelerator units, with the world's most advanced compiler and heterogenous runtime. Achieve performance on par with C++ and CUDA without the complexity.

  • Python

    Single Thread Distribution

  • Mojo🔥

    Parallel processing across multiple cores

Mojo enables systems programming features so you can process information exponentially faster.

LanguagesTime (s)*Speedup Vs Python
Python 3.10.91027s1X
PYPY46.1s22x
Scalar C++0.20s5,000x
Mojo🔥

0.03s

68,000x

* Algorithm

Mandelbrot

Instance

AWS C1.xlarge

Intel Xeon

Access the entire Python ecosystem

Experience true interoperability with the Python ecosystem. Seamlessly intermix arbitrary libraries like Numpy and Matplotlib and your custom code with Mojo.

Python

def make_plot(m: Matrix):
  plt = Python.import_module("matplotlib.pyplot")
  fig = plt.figure(1, [10, 10 * yn // xn], 64)
  ax = fig.add_axes([0.0, 0.0, 1.0, 1.0], False, 1)
  plt.imshow(image)
  plt.show()

make_plot(compute_mandelbrot())

Upgrade your models to full pipelines with MAX

Easily extend your models with pre and post- processing operations, or replace operations with custom ones. Take advantage of kernel fusion, graph rewrites, shape functions, and more.