Introducing Mojo: The Next Frontier in Programming Languages
Discover Mojo, a cutting-edge programming language blending Pythonic syntax with robust memory management. Designed by Chris Lattner, it targets AI applications and features traits, generics, and metaprogramming. Learn how Mojo innovates by borrowing the best from other languages.

Introduction
I've always had a passion for learning new programming languages, a journey that began in the 80s. Back then, I thought I could learn programming just by reading a magazine, even without access to a computer in my homeland. My next significant memory was learning to write C using a Casio PB-2000 during my first year of university, followed by Turbo Pascal on my first PC.
Other languages didn't leave as lasting an impression, either because the language itself was underwhelming, like COBOL. Or I failed to appreciate what I was learning, due to a combination of poor teaching and my immaturity, during the few weeks we got of LISP.
After attempting to run a small company selling programs written in Clipper, I landed a job writing Java, and another writing C#. Both opportunities came with the excitement of relocating to new countries. Yet, none of these languages evoked the same thrill as that initial encounter with Basic in a magazine or C on a calculator.
The last language that stirred a similar sense of excitement was Scala, which I discovered in 2008. While one might debate Scala's success, its uniqueness and special qualities are undeniable.
That is, until I learned about the Mojo programming language. Mojo, with its combination of features, stands out as a candidate for the next big programming language.
What Makes Mojo Special?
Mojo stands out in the crowded field of programming languages for several compelling reasons, positioning it as a strong candidate for the next big success in technology.
Compiled to Binary
One of the most notable features of Mojo is that it compiles directly to binary. Unlike interpreted languages or those targeting a specific runtime or virtual machine, Mojo is designed to run on bare-metal hardware. This capability opens up possibilities for system-level programming with a language that boasts a Pythonic syntax, making it uniquely accessible and powerful.
Targeting AI: The Killer App
Many programming languages struggle to gain traction because they lack a clear, compelling use case to justify their adoption. Mojo, however, targets the mother of all killer apps: Artificial Intelligence.
Programming AI models is inherently complex, but a chunk of this complexity is incidental, stemming from the need to use Python for high-level tasks while resorting to low-level languages like C, C++, or hardware-specific languages like CUDA for performance-critical sections. Mojo aims to bridge this gap, providing a language that can be used seamlessly from the top to the bottom of the stack.
Visionary Leadership
The team behind Mojo has the pedigree to deliver on this ambitious vision. Chris Lattner, the driving force behind LLVM and Swift, brings a wealth of experience and innovation to the table. His leadership ensures that Mojo is not just another language but a well-thought-out solution to modern programming challenges.
Chris Lattner's extensive background in compiler technology and language design is well-documented. His work on LLVM has revolutionized compiler infrastructure, enabling advanced optimizations and cross-platform compatibility. With Swift, he introduced a language that combined performance with developer-friendly features, freeing Apple developers from the pain of writing Objective-C.
Lattner's vision for Mojo is to create a language that leverages the best of modern programming paradigms while addressing the needs of today's most demanding applications, particularly in AI.
Eclectic and Open Design
Beyond its technical capabilities, Mojo's design philosophy is open to adopting the best ideas from other programming languages. This eclectic approach ensures that Mojo is not just a blend of existing features, but a forward-thinking language that continuously evolves to meet the needs of developers.
Good Artists Copy, Great Artists Steal
Mojo has stolen some of the coolest features from different programming languages and integrated them into an appealing package:
Pythonic Syntax
Mojo's syntax is heavily influenced by Python, making it intuitive and user-friendly. Besides the syntax, Mojo adopts other mechanisms from Python, like dunder methods to allow our code to naturally integrate with language features.
Package and Dependency Management
Mojo includes a system for package and dependency management, which is crucial for building and distributing software. This feature, inspired by systems like Go's modules or Rust's Cargo, allows developers to easily manage external libraries and dependencies, ensuring that projects can be built and shared efficiently.
Memory Management and Borrow Checker
Mojo's memory model is heavily influenced by Rust, from which it took the ownership and borrowing model enforced by the compiler. This allows Mojo to generate memory efficient code without the disadvantages of garbage collectors.
Traits
Mojo incorporates traits, a feature included in Rust, but originally made popular by Scala. Traits enable sharing of interfaces, but unlike interfaces they can also share behaviours or default implementation for the methods included in the interface.
Strong Typing with Type Inference and Progressive Types
There are many languages with strong typing, but the combination of strong types with type inference originated with Standard ML, which later influenced multiple languages like Haskell, OCaml and Scala.
However, I think the most direct influence is Typescript, which adds gradual typing to the previous features. Allowing developers to adopt strong typing without having to do it all at once for the complete code base.
Generics
Generic enables us to write data structures and code that works over with different unrelated types. For example, if we to write code to reverse a list, we should be able to achieve it with a single function without having to repeat code to deal with different element types. Reversing a list is the same if the elements are integers, or strings, or other objects.
This feature also traces its lineage to Standard ML, but it has been adopted by many languages, and it is difficult to pinpoint which implementation was the direct inspiration for generics in Mojo.
Meta-programming
In programming languages with meta-programming support, we can write programs that change their code or whose output is other programs. Though the feature has a storied tradition starting with LISP.
Rust also supports macros, but the version included with Mojo is directly inspired by a programming language called Zig, which introduced the idea of comp-time and using the same language for it. This fact has been acknowledged by Chris Lattner in multiple interviews.
Linear Types
Mojo introduces linear types, their main appeal is writing code that resources are used in a controlled manner, for example making sure certain methods are called before they go out of scope. A classical use is preventing resource leaks.
This feature is inspired by a language called Vale, whose creator is part of the Modular team.

Some Features Still Missing in Mojo
Mojo is a fast-moving language. Hence, it is important to check with the latest version of the language if some feature is supported or not. The following is a list of missing features that I consider critical and hope Modular add them to the language sooner rather than later.
Lambda Expressions
I consider Lambda expressions to be the most important feature still missing in Mojo. Lambda expressions allow us to create flexible libraries by passing anonymous functions as inputs to other functions, or return functions from our own functions. Its absence complicates the use of some functional programming design patterns like Functors, or Folding collections.
Comprehensions
Mojo does not currently support comprehensions, such as list, dictionary, or set comprehensions, which are popular in Python for creating collections in a concise and readable manner.
Generators
Generators, which provide a way to create iterators with a more memory-efficient approach by yielding values on-the-fly, are also missing in Mojo. In Python, the yield
keyword is used to create generator functions that can produce a sequence of values lazily. This feature is particularly valued in data processing and streaming applications, as it allows for handling large datasets or streams of data without loading everything into memory at once.
Pattern Matching
Pattern matching is another feature absent in Mojo. This powerful construct, found in languages like Haskell, Scala, and more recently in Python, allows for more expressive and safer code by enabling complex conditional logic based on the structure of data. Pattern matching can simplify code that involves multiple conditional checks and data transformations.
Conclusion
My journey through the landscape of programming languages has included some exciting encounters and the occasional disappointment.
Not since Scala in 2008 have I met a new programming language as exciting as Mojo. Its unique blend of Pythonic syntax, robust memory management, and advanced features like traits and generics, and compiling to metal stands out as a promising candidate for the next big programming language.
A system's programming language, that is as easy to read as Python, with memory guarantees and predictable performance that has a clear application, and it's backed by a talented team with the chops to deliver on their plan.
Whether Mojo will achieve widespread adoption remains to be seen, but its innovative approach and strong foundation make it a language worth learning. It is not very often that one comes across a new programming language that is fresh and exciting, while offering a potential good return of investment.
Support The Turing Taco Tales
At The Turing Taco Tales, my goal is to create a space where technology enthusiasts can learn, share, and grow without the distractions that often come with browsing the web. In my experience, advertisements can make websites less enjoyable and, in some cases, nearly unreadable. To ensure that The Turing Taco Tales remains a clean, user-friendly, and ad-free environment, I rely on the support of my readers.
If you find value in the content I create and would like to help me continue providing high-quality, ad-free articles, consider supporting The Turing Taco Tales. Your contributions, no matter how small, make a significant difference and help me focus on what I do best: creating informative and engaging content for you.
There are several ways you can support The Turing Taco Tales:
- Donations: If you'd like to make a one-time or recurring donation, you can do so through the button below. Every little bit helps, and it is greatly appreciated!
- Spread the Word: Share The Turing Taco Tales with your friends, colleagues, and social media networks. The more people who discover and engage with the content, the more I can continue to grow and improve the site.
- Swag: I'm also experimenting with RedBubble, offering programming-related swag. If you're inclined to purchase some tech-themed merchandise, check out my RedBubble store. It's a fun way to support The Turing Taco Tales while getting something cool in return!

Thank you for being a part of The Turing Taco Tales community and for your support. Together, we can create a space where technology enthusiasts can learn, share, and grow without the distractions of advertisements.