Mojo Miji - A Guide to Mojo Programming Language from A Pythonista's Perspective
by Yuhao Zhu (朱宇浩)
Notes
This Miji is compatible with Mojo v1.2.0 (2026-10-22).
For the example programs featured in this Miji, you can find them in the GitHub repository.
- INTRODUCTION
- PART I: START WITH MOJO
- 1 Install pixi and extension (Package manager and VS Code extension)
- 2 Initiate Mojo project (Install Mojo compiler)
- 3 My first Mojo program (Hello, world!)
- PART II: MOVE INTO MOJO
- 4 Convert Python code into Mojo (Four examples, Python becomes Mojo)
- 5 Things that are in common (Similarities between Python and Mojo)
- 6 Things that are different (Differences between Python and Mojo)
- PART III: BASIC MOJO
- 7 Variables
- 8 Copy and move
- 9 Data types - basic (Int, float, bool, etc.)
- 10 Data types - composite (List et al.)
- 11 Data type - string (similar to
strin Python) - 12 Literals and type inference
- 13 Functions
- 14 Operators and assignment expressions
- 15 Control flows (Loops and conditionals)
- 16 Error handling and raises (Exceptions)
- 17 Structs (Similar to classes in Python)
- 18 Pattern matching (
matchandcase) - 19 Modules and packages (Modular programming)
- 20 Use Python in Mojo (Your Python code can still be used!)
- PART IV: ADVANCED MOJO
- 21 Data type - SIMD (The first-class
SIMDtype) - 22 Parameterization
- 24 Ownership (The ownership system)
- 25 References and pointers (The borrowing system)
- 26 Lifetimes and origins (The lifetime system)
- 21 Data type - SIMD (The first-class
- PART V: APPLY MOJO (Let's use Mojo to program something useful)
- 27 Calendar app in Mojo (A command-line calendar app)
- 28 Matrix library in Mojo (A simple matrix library)
- PART VI: EXTEND MOJO
- 29 Arbitrary-precision numbers (A library for arbitrary-precision integers and decimals)
- 30 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)
- About the author (A brief introduction of the author)