# Mojo programming language documentation > Official documentation for the Mojo programming language, including the manual, language reference, standard library API docs, and more. For section-specific indexes, see: - [Mojo standard library (index only)](/llms-stdlib.txt) - [Mojo layout library (index only)](/llms-layout.txt) - [Mojo manual (full content)](/llms-manual.txt) - [Mojo language reference (full content)](/llms-reference.txt) - [Mojo CLI reference (full content)](/llms-cli.txt) ## Table of Contents - [Mojo language basics](https://mojolang.static.modular-staging.com/docs/manual/basics.md): An overview of the Mojo language. - [Control flow](https://mojolang.static.modular-staging.com/docs/manual/control-flow.md): Mojo control flow statements. - [@align](https://mojolang.static.modular-staging.com/docs/manual/decorators/align.md): Specifies a minimum alignment for a struct. - [@always_inline](https://mojolang.static.modular-staging.com/docs/manual/decorators/always-inline.md): Copies the body of a function directly into the body of the calling function. - [@compiler.register](https://mojolang.static.modular-staging.com/docs/manual/decorators/compiler-register.md): Registers a custom operation for use with the MAX Graph API. - [@__copy_capture](https://mojolang.static.modular-staging.com/docs/manual/decorators/copy-capture.md): Captures register-passable typed values by copy. - [@deprecated](https://mojolang.static.modular-staging.com/docs/manual/decorators/deprecated.md): Mojo's `@deprecated` decorator marks outdated APIs and schedules them for removal. When used with the `use` parameter, it also provides migration s... - [@doc_hidden](https://mojolang.static.modular-staging.com/docs/manual/decorators/doc-hidden.md): Hides declarations from generated documentation. - [@explicit_destroy](https://mojolang.static.modular-staging.com/docs/manual/decorators/explicit-destroy.md): Prevents automatic destruction by a `__del__()` method and requires explicit cleanup through named destructor methods. - [@export](https://mojolang.static.modular-staging.com/docs/manual/decorators/export.md): Marks a function for export. - [@fieldwise_init](https://mojolang.static.modular-staging.com/docs/manual/decorators/fieldwise-init.md): Generates fieldwise constructor for a struct. - [@implicit](https://mojolang.static.modular-staging.com/docs/manual/decorators/implicit.md): Marks a constructor as eligible for implicit conversion. - [Mojo decorators](https://mojolang.static.modular-staging.com/docs/manual/decorators.md): A reference of Mojo's built-in decorators - [@no_inline](https://mojolang.static.modular-staging.com/docs/manual/decorators/no-inline.md): Prevents a function from being inlined. - [@parameter](https://mojolang.static.modular-staging.com/docs/manual/decorators/parameter.md): Executes a function or if statement at compile time. - [@staticmethod](https://mojolang.static.modular-staging.com/docs/manual/decorators/staticmethod.md): Declares a struct method as static. - [Errors, error handling, and context managers](https://mojolang.static.modular-staging.com/docs/manual/errors.md): Mojo represents errors as values—specifically, as alternate return values from - [Functions](https://mojolang.static.modular-staging.com/docs/manual/functions.md): Introduction to Mojo functions. - [Generics](https://mojolang.static.modular-staging.com/docs/manual/generics.md): Write code that builds and runs across many types using generics. - [Get started with Mojo](https://mojolang.static.modular-staging.com/docs/manual/get-started.md): Install Mojo and learn the language basics by building a complete Mojo program - [Intro to GPUs](https://mojolang.static.modular-staging.com/docs/manual/gpu/architecture.md): An overview of GPU architecture and terminology. - [GPU block and warp operations and synchronization](https://mojolang.static.modular-staging.com/docs/manual/gpu/block-and-warp.md): A description of GPU block and warp operations and synchronization. - [GPU programming fundamentals](https://mojolang.static.modular-staging.com/docs/manual/gpu/fundamentals.md): A description of the fundamental GPU APIs in Mojo. - [Get started with GPU programming](https://mojolang.static.modular-staging.com/docs/manual/gpu/intro-tutorial.md): Learn the basics of GPU programming with Mojo - [Mojo Manual](https://mojolang.static.modular-staging.com/docs/manual.md): A comprehensive guide to the Mojo programming language. - [Install Mojo](https://mojolang.static.modular-staging.com/docs/manual/install.md): You can install Mojo using pixi, uv, conda, pip, or other Python/Conda package managers. - [Introduction to layouts](https://mojolang.static.modular-staging.com/docs/manual/layout/layouts.md): Using layouts to describe multidimensional data. - [Using LayoutTensor](https://mojolang.static.modular-staging.com/docs/manual/layout/tensors.md): Using LayoutTensor to manipulate multidimensional data. - [Value destruction](https://mojolang.static.modular-staging.com/docs/manual/lifecycle/death.md): An explanation of when and how Mojo destroys values. - [Intro to value lifecycle](https://mojolang.static.modular-staging.com/docs/manual/lifecycle.md): An introduction to the value lifecycle. - [Deep dive - Instance initialization](https://mojolang.static.modular-staging.com/docs/manual/lifecycle/initialization.md): Understanding logical and fieldwise initialization is fundamental to working with structs. - [Value creation](https://mojolang.static.modular-staging.com/docs/manual/lifecycle/life.md): An explanation of when and how Mojo creates values. - [Compile-time evaluation](https://mojolang.static.modular-staging.com/docs/manual/metaprogramming/comptime-evaluation.md): When and how code is executed at compile time. - [Comptime constraints and assertions](https://mojolang.static.modular-staging.com/docs/manual/metaprogramming/constraints.md): How to use Mojo's constraint system to express program guarantees. - [Intro to metaprogramming](https://mojolang.static.modular-staging.com/docs/manual/metaprogramming.md): An overview of Mojo's metaprogramming features. - [Materializing compile-time values at run time](https://mojolang.static.modular-staging.com/docs/manual/metaprogramming/materialization.md): How to use compile-time values at run time. - [Operators](https://mojolang.static.modular-staging.com/docs/manual/operators.md): Arithmetic, comparison, bitwise, boolean, and assignment operators in Mojo, with precedence and examples. - [Modules and packages](https://mojolang.static.modular-staging.com/docs/manual/packages.md): Learn how to organize Mojo code into modules and packages. - [Parameterization](https://mojolang.static.modular-staging.com/docs/manual/parameters.md): Creating and using parameterized structs and functions. - [Intro to pointers](https://mojolang.static.modular-staging.com/docs/manual/pointers.md): An overview of accessing memory using Mojo's pointer types. - [Unsafe pointers](https://mojolang.static.modular-staging.com/docs/manual/pointers/unsafe-pointers.md): Using unsafe pointers to access dynamically-allocated memory. - [Python interoperability](https://mojolang.static.modular-staging.com/docs/manual/python.md): Using Python and Mojo together. - [Calling Mojo from Python](https://mojolang.static.modular-staging.com/docs/manual/python/mojo-from-python.md): How to import and use Mojo modules in Python code. - [Calling Python from Mojo](https://mojolang.static.modular-staging.com/docs/manual/python/python-from-mojo.md): How to import and use Python modules in Mojo code. - [Python types](https://mojolang.static.modular-staging.com/docs/manual/python/types.md): Using Mojo types in Python, and Python types in Mojo. - [Mojo tips for Python devs](https://mojolang.static.modular-staging.com/docs/manual/python-to-mojo.md): Explore ways Mojo differs from Python as you prepare to migrate - [Mojo quickstart](https://mojolang.static.modular-staging.com/docs/manual/quickstart.md): Get up and running fast with the Mojo programming language - [Reflection](https://mojolang.static.modular-staging.com/docs/manual/reflection.md): Compile-time reflection utilities for introspecting Mojo types and functions - [Mojo structs](https://mojolang.static.modular-staging.com/docs/manual/structs.md): Introduction to Mojo structures (structs). - [Add operator support to custom types](https://mojolang.static.modular-staging.com/docs/manual/structs/operator-support.md): Implement operators for your custom types by creating dunder methods in your struct. - [Self-referential structs](https://mojolang.static.modular-staging.com/docs/manual/structs/reference.md): Mojo structs can't directly contain themselves. Learn how to use pointers to build linked lists, trees, and other self-referential data structures. - [Traits](https://mojolang.static.modular-staging.com/docs/manual/traits.md): Define shared behavior for types. - [Types](https://mojolang.static.modular-staging.com/docs/manual/types.md): Standard Mojo data types. - [Intro to value ownership](https://mojolang.static.modular-staging.com/docs/manual/values.md): Introduction to Mojo value ownership. - [Lifetimes, origins, and references](https://mojolang.static.modular-staging.com/docs/manual/values/lifetimes.md): Working with origins and references. - [Ownership](https://mojolang.static.modular-staging.com/docs/manual/values/ownership.md): How Mojo shares references through function arguments. - [Value semantics](https://mojolang.static.modular-staging.com/docs/manual/values/value-semantics.md): An explanation of Mojo's value-semantic defaults. - [Variables](https://mojolang.static.modular-staging.com/docs/manual/variables.md): Introduction to Mojo variables. - [Mojo language reference](https://mojolang.static.modular-staging.com/docs/reference.md): Reference for the syntax, keywords, decorators, and more - [Mojo compound statements reference](https://mojolang.static.modular-staging.com/docs/reference/mojo-compound-statements.md): Complete reference for Mojo compound statements. Covers if statements, loops, error handling with try/except, context managers with with, and compi... - [Mojo expression reference](https://mojolang.static.modular-staging.com/docs/reference/mojo-expressions.md): Complete reference for Mojo expressions. Covers parenthesized expressions, tuples, collection displays, member access, calls, subscripts, slices, t... - [Mojo function declarations reference](https://mojolang.static.modular-staging.com/docs/reference/mojo-function-declarations.md): Reference for Mojo function declaration syntax. Covers signatures, argument conventions, markers, variadic arguments, effects, return types, and sp... - [Mojo inline MLIR reference](https://mojolang.static.modular-staging.com/docs/reference/mojo-inline-mlir.md): Use Mojo's inline MLIR built-ins to call hardware intrinsics, atomic operations, and GPU dialect operations that the language doesn't yet expose na... - [Mojo identifiers, keywords, and conventions reference](https://mojolang.static.modular-staging.com/docs/reference/mojo-keywords.md): Complete reference for Mojo identifiers, keywords, and conventions. Covers naming rules, reserved words, escaped identifiers, argument and variable... - [Mojo literals reference](https://mojolang.static.modular-staging.com/docs/reference/mojo-literals.md): Complete reference for Mojo literal syntax. Covers integer, floating-point, string, t-string, boolean, None, Self, discard, and ellipsis literals w... - [Mojo numeric types reference](https://mojolang.static.modular-staging.com/docs/reference/mojo-numeric-types.md): Complete reference for Mojo numeric types. Covers SIMD, DType, Scalar, Int, UInt, sized integers, floating-point types, Byte, numeric literals, and... - [Mojo operator reference](https://mojolang.static.modular-staging.com/docs/reference/mojo-operators.md): Operator precedence, associativity, and symbols for Mojo. - [Mojo simple statements reference](https://mojolang.static.modular-staging.com/docs/reference/mojo-simple-statements.md): Complete reference for Mojo simple statements. Covers import statements, expression statements, assignment statements, and other simple statements. - [Mojo struct declarations reference](https://mojolang.static.modular-staging.com/docs/reference/mojo-struct-declarations.md): Reference for Mojo struct declarations, fields, methods, parameters, trait conformance, initializers, and lifecycle methods. - [Mojo trait declarations](https://mojolang.static.modular-staging.com/docs/reference/mojo-trait-declarations.md): Reference for Mojo trait declarations, required and provided methods, associated types, trait inheritance, trait composition, and conformance rules. - [Mojo types reference](https://mojolang.static.modular-staging.com/docs/reference/mojo-types.md): Explore all Mojo built-in types, including numeric, string, boolean, and collection types, and understand how they fit into Mojo's statically typed... - [Compilation targets](https://mojolang.static.modular-staging.com/docs/tools/compilation.md): Build Mojo code for a different architecture, CPU, or GPU than your development machine. - [Debugging](https://mojolang.static.modular-staging.com/docs/tools/debugging.md): Debugging Mojo programs. - [GPU debugging](https://mojolang.static.modular-staging.com/docs/tools/gpu-debugging.md): Debugging Mojo programs on GPU. - [Jupyter notebooks](https://mojolang.static.modular-staging.com/docs/tools/notebooks.md): Using Mojo in local and Colab Jupyter Notebooks - [Packaging](https://mojolang.static.modular-staging.com/docs/tools/packaging.md): How to package your Mojo project for distribution - [Mojo AI skills](https://mojolang.static.modular-staging.com/docs/tools/skills.md): Official AI agent skills for developing projects with Mojo and MAX. Follows the Agent Skills Standard and encodes best practices for AI coding agents. - [Testing](https://mojolang.static.modular-staging.com/docs/tools/testing.md): Testing Mojo programs. - [mojo build](https://mojolang.static.modular-staging.com/docs/cli/build.md): Builds an executable from a Mojo file. - [mojo debug](https://mojolang.static.modular-staging.com/docs/cli/debug.md): Launches the Mojo debugger using the command-line interface or an external editor. - [mojo demangle](https://mojolang.static.modular-staging.com/docs/cli/demangle.md): Demangles the given name. - [mojo doc](https://mojolang.static.modular-staging.com/docs/cli/doc.md): Compiles docstrings from a Mojo file. - [mojo format](https://mojolang.static.modular-staging.com/docs/cli/format.md): Formats Mojo source files. - [mojo](https://mojolang.static.modular-staging.com/docs/cli.md): The Mojo🔥 command line interface. - [mojo package](https://mojolang.static.modular-staging.com/docs/cli/precompile.md): Compiles a Mojo package. - [mojo repl](https://mojolang.static.modular-staging.com/docs/cli/repl.md): Launches the Mojo REPL. - [mojo run](https://mojolang.static.modular-staging.com/docs/cli/run.md): Builds and executes a Mojo file. - [Mojo standard library](https://mojolang.static.modular-staging.com/docs/std.md): All the data types, structs, traits, functions, and other APIs included with Mojo. - [Layout library](https://mojolang.static.modular-staging.com/docs/layout.md): Provides layout and layout tensor types, which abstract memory layout for multidimensional data.