# Mojo — Python-Superset Language for AI Performance > Mojo is a programming language from Modular that extends Python syntax with systems-level features, delivering performance comparable to C and Rust for AI and HPC workloads. ## Install Save in your project root: # Mojo — Python-Superset Language for AI Performance ## Quick Use ```bash # Install the Modular CLI curl -s https://get.modular.com | sh - # Run a Mojo file modular install mojo mojo run hello.mojo ``` ## Introduction Mojo is a new programming language created by Modular (founded by Chris Lattner, the creator of LLVM and Swift). It is a strict superset of Python that adds ownership semantics, SIMD primitives, and compile-time metaprogramming to achieve C-level performance. Mojo lets you progressively opt into low-level control without leaving the Python ecosystem. ## What Mojo Does - Runs standard Python code and interoperates with the entire Python ecosystem - Compiles to native machine code via MLIR and LLVM for maximum performance - Provides zero-cost abstractions with ownership, borrowing, and value semantics - Supports hardware-level SIMD, tiling, and parallelism for AI and numerical workloads - Enables compile-time metaprogramming with parameters and alias expressions ## Architecture Overview Mojo's compiler pipeline starts with a Python-compatible parser and progressively lowers code through MLIR dialects (the same infrastructure behind TensorFlow and PyTorch compilers). It performs ownership analysis, lifetime checking, and type specialization before emitting optimized LLVM IR. The runtime bridges Mojo's native objects with CPython via seamless interop, allowing direct use of NumPy, Pandas, and other Python libraries. ## Self-Hosting & Configuration - Install the Modular SDK via the official installer for Linux and macOS - Requires a modern x86-64 or ARM64 system with glibc 2.17+ - Mojo files use the `.mojo` or `.🔥` extension - Project dependencies from Python are accessed directly through `import` statements - The Modular CLI provides `mojo run`, `mojo build`, and `mojo repl` commands ## Key Features - Full Python 3 syntax compatibility with gradual typing via `fn` and `def` - Ownership and borrow checker inspired by Rust, applied only where you opt in - Auto-tuning and adaptive compilation for target hardware (CPU, GPU) - Built-in SIMD types for vectorized operations without intrinsics - Integrated Jupyter notebook support for interactive development ## Comparison with Similar Tools - **Python** — interpreted with GIL; Mojo compiles to native code with true parallelism - **Rust** — strict ownership everywhere; Mojo applies ownership gradually alongside Python semantics - **C++** — manual memory management; Mojo provides Python ergonomics with comparable speed - **Julia** — JIT-compiled with multiple dispatch; Mojo is AOT-compiled with Python syntax - **Cython** — Python-to-C transpiler; Mojo is a new language with deeper hardware control ## FAQ **Q: Can I import and use Python libraries in Mojo?** A: Yes. Mojo can import any Python module and use Python objects directly. The interop layer handles type conversion automatically. **Q: Is Mojo open source?** A: The Mojo standard library and runtime are open source under the Apache 2.0 license in the Modular GitHub repository. The compiler is available through the Modular SDK. **Q: What hardware does Mojo target?** A: Mojo currently targets x86-64 and ARM64 CPUs. GPU support via MLIR backends is in development. **Q: How does Mojo compare to Python in speed?** A: Mojo can be orders of magnitude faster than CPython. Benchmarks show up to 68,000x speedups on specific numerical workloads when using Mojo's systems features. ## Sources - https://github.com/modular/modular - https://www.modular.com/mojo --- Source: https://tokrepo.com/en/workflows/2853a169-3ba8-11f1-9bc6-00163e2b0d79 Author: AI Open Source