Mojo - Python Superset For Go-Faster Hardware
Written by Sue Gee   
Monday, 07 October 2024

Mojo, the new language from Chris Lattner and his AI-focused company Modular, has entered the top 50 of the TIOBE index, even though it it was only launched in 2023.

I have to admit that I'd not heard of Mojo before reading Paul Jansen's latest post about the TIOBE index. He writes:

The language Mojo, which is a mix of Python and Swift, but much faster, enters the top 50 for the first time. The fact that this language is only 1 year old and already showing up, makes it a very promising language.

From my investigation of the language, it seems to be nothing but a superset of Python with types, although influences from Swift come from the fact they share the same author.

Mojo is just the latest in an impressive string of compilers and languages from Chris Lattner. While a graduate student at the University of Illinois at Urbana-Champaign in 2000, he co-created LLVM (Low-Level Virtual Machine) a modular compiler infrastructure that is regarded a cornerstone of modern programming languages and tools. Having joined Apple in 2005, Lattner led the development of the Swift programming language. launched in 2014. In 2017, with researchers at Google, he developed the compiler infrastructure MLIR (Multi-Level Intermediate Representation). Designed to provide a unified representation for various levels of abstraction in programming languages and hardware architectures, MLIR has been adopted by several major projects, including TensorFlow, PyTorch, and the XLA compiler.

In 2023, after a spell at Tesla, when he oversaw the development of the company's self-driving car technology. Lattner founded Modular, an AI-focused technology company that aims to provides a platform to unify the world's ML/AI infrastructure running on TPUs and beyond and this led to the need for the Mojo programming language.

Mojo is a superset of Python, influenced by C and MLIR. It is described as combining the usability of Python with the performance of C in order to unlock unparalleled programmability of AI hardware and extensibility of AI models.

Mojo is significantly faster than Python due to its static typing and compilation to native code and, while both languages have a similar syntax, Mojo incorporates more modern language features like pattern matching and type inference.

I wanted to know more about Mojo and who better to introduce it than its creator, Chris Lattner. Luckily Lex Fridman had already done an interview: 

One amusing takeaway from this was how Mojo uses the fire emoji as a file extension, something that you can see for yourself by visting the Mojo Playground:mojo playground

Modular also provides MAX, the Modular Accelerated Xecution platform, a unified set of APIs and tools that help you build and deploy high-performance AI pipelines. The idea is that Mojo with MAX enables state of the art latency and throughput without writing low-level CUDA code. There's also a package manager called Magic, a CLI which allows you to instantly launch code examples and create new projects that are fully contained and reproducible across systems. The latest version is MAX 24.5 and with it comes Mojo 24.5, described as it's biggest release ever, and which includes several new core language changes, the most important being a unified pointer type UnsafePointer, and standard library enhancements.

Mojo logo

 

More Information

Mojo Website

Lex Fridman Podcast #381

Related Articles

Recognition for LLVM

Lex Fridman Talks to Gosling, Kernighan and Knuth

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


Remembering Grace Hopper On Her 114th Anniversary
09/12/2024

Today sees the start of Computer Science Education Week and  the 2024 Hour of Code. These educational event are timed to coincide with Grace Hopper's birthday on January 9th, 1906 due to her conc [ ... ]



AI At edX With 30% Savings
13/12/2024

edX is offering a 30% discount on selected courses and program bundles until December 19th. We look at  AI-related certifications that could boost your resume in 2025.


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Last Updated ( Monday, 07 October 2024 )