Mojo Miji - A Guide to Mojo Programming Language from A Pythonista's Perspective
by Yuhao Zhu (朱宇浩)
Notes
This Miji is compatible with Mojo v0.26.1 (2026-01-29).
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 Modules and packages (Modular programming)
- 19 Use Python in Mojo (Your Python code can still be used!)
- PART IV: ADVANCED MOJO
- 20 Data type - SIMD (The first-class
SIMDtype) - 21 Parameterization
- 23 Ownership (The ownership system)
- 24 References and pointers (The borrowing system)
- 25 Lifetimes and origins (The lifetime system)
- 20 Data type - SIMD (The first-class
- PART V: APPLY MOJO (Let's use Mojo to program something useful)
- 26 Calendar app in Mojo (A command-line calendar app)
- 27 Matrix library in Mojo (A simple matrix library)
- PART VI: EXTEND MOJO
- 28 Arbitrary-precision numbers (A library for arbitrary-precision integers and decimals)
- 29 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)