Mojo Miji - A Guide to Mojo Programming Language from A Pythonista's Perspective
by Yuhao Zhu 朱宇浩
Compatible Mojo version
This Miji is compatible with Mojo v25.4 (2025-06-18).
- INTRODUCTION
- PART I: START WITH MOJO
- Install pixi and extension (Package manager and VS Code extension)
- Initiate Mojo project (Install Mojo compiler)
- My first Mojo program (Hello, world!)
- PART II: MOVE INTO MOJO
- Convert Python code into Mojo (Four examples, Python becomes Mojo)
- Things that are in common (Similarities between Python and Mojo)
- Things that are different (Differences between Python and Mojo)
- PART III: BASIC MOJO
- Variables
- Data types - basic (Int, float, bool, etc.)
- Data types - composite (List et al.)
- Data type - string (similar to
str
in Python) - Literals and type inference
- Functions
- Operators and assignment expressions
- Control flows (Loops and conditionals)
- Error handling and raises (Exceptions)
- Structs (Similar to classes in Python)
- Modules and packages (Modular programming)
- PART IV: ADVANCED MOJO
- Data type - SIMD (The first-class
SIMD
type)
- Parameterization
- Generic and traits
- Ownership (The ownership system)
- References and pointers (The borrowing system)
- Lifetimes and origins (The lifetime system)
- Data type - SIMD (The first-class
- PART V: APPLY MOJO (Let's use Mojo to program something useful)
- Design of MatMojo library (Preparation for a matrix library)
- Make it work (Define and implement the basic functionalities)
- PART VI: EXTEND MOJO
- Arbitrary-precision numbers (A library for arbitrary-precision integers and decimals)
- Multi-dimensional arrays (A library for numerical computing and NDArray)
- PART VII: MISCELLANEOUS
- Glossary of Mojo terms (Find explanations of key terms and concepts)
- Tips and warnings (Do not fall into the pits I fell into)
- Useful resources and links (Online resources and links related to Mojo)
- Wishes for extra features (Some features I wish Mojo could have)
- About the author (A brief introduction of the author)