Version: 1.1.0
Mojo standard library
The standard library is the types and functions that ship with the compiler.
This copy lists each module and the job it does. Individual function pages in the upstream docs are generated from docstrings and are not reproduced one by one here.
Modules
- builtin — Names that are always in scope:
Int,String,List,Dict,Optional,Tuple,Error,Bool, and the SIMD aliases. - collections — Extra containers such as sets, deques, and inline variants of the builtin collections.
- memory — Pointers, spans, allocation, and low-level copies.
- algorithm — Sorting, searching, and parallel iteration over collections and grids.
- math — Scalar and SIMD math: rounding, trigonometry, and common numeric helpers.
- os — Environment variables, processes, and operating-system queries.
- pathlib — Path values that join, split, and inspect filesystem locations.
- sys — Compiler and runtime queries, including the target and argument list.
- python — Import Python modules and hold
PythonObjectvalues. - testing — Assertions used by
mojo test. - time — Clocks, durations, and sleep.
- random — Pseudo-random numbers and shuffles.
- hashlib — Hash functions for bytes and strings.
- benchmark — Timing helpers for microbenchmarks.
- complex — Complex numbers.
- compile — Compile-time helpers used by parameterized libraries.
- utils — Small helpers that do not belong to a larger module.
- gpu — Index, block, and barrier helpers used by accelerator kernels.
Reading a signature
Parameters are in square brackets. Arguments are in parentheses. The API reading guide shows an example.