Skip to main content

Mojo🔥 modules

These are all the modules in the Mojo standard library.

anytype

Defines the AnyType trait

arc

Reference-counted smart pointers

arg

Implements functions and variables for interacting with execution and system environment

atomic

Implements the Atomic class

base64

Provides functions for base64 encoding strings

bencher

benchmark

Implements the benchmark module for runtime benchmarking

bin

Implements the bin() function

bit

Provides functions for bit manipulation

bool

Implements the Bool class

breakpoint

This module includes the builtin breakpoint function

buffer

Implements the Buffer class

builtin_list

Implements the ListLiteral class

builtin_slice

Implements slice

comparable

compiler

complex

Implements the Complex type

constrained

Implements compile time constraints

coroutine

Implements classes and methods for coroutines

debug

This module includes the debug hook functions

debug_assert

Implements a debug assert

dict

Defines Dict, a collection that stores key-value pairs

dtype

Implements the DType class

env

Implements basic routines for working with the OS

equality_comparable

error

Implements the Error class

ffi

Implements a foreign functions interface (FFI)

file

Implements the file based methods

file_descriptor

Higher level abstraction for file stream

float_literal

Implements the FloatLiteral class

fstat

Implements the file system stat operations

functional

Implements higher-order functions

hash

Implements the Hashable trait and

hex

Provides the hex function

index

Implements StaticIntTuple which is commonly used to represent N-D indices

info

Implements methods for querying the host target info

inline_list

Defines the InlineList type

inline_string

Implements a string that has a small-string optimization which avoids heap allocations for short strings

int

Implements the Int class

int_literal

Implements the IntLiteral class

intrinsics

Defines intrinsics

io

Provides utilities for working with input/output

len

Provides the len() function and its associated traits

list

Defines the List type

list

Provides utilities for working with static and variadic lists

loop

Implements higher-order functions

math

Defines math utilities

math

Defines basic math functions for use in the open source parts of the standard library since the math package is currently closed source and cannot be depended on in the open source parts of the standard library

memory

Defines functions for memory manipulations

memory

memory

Implements parallel_memcpy

numerics

Defines utilities to work with numeric types

object

Implements PythonObject

object

Defines the object type, which is used to represent untyped values

optional

Defines Optional, a type modeling a value which may or may not be present

os

Implements os methods

param_env

Implements functions for retrieving compile-time defines

path

Implements Path and related functions

path

pathlike

Implements PathLike trait

polynomial

Provides two implementations for evaluating polynomials

python

Implements Python interoperability

random

Provides functions for random numbers

range

Implements a 'range' call

rebind

Implements type rebind

reduction

Implements SIMD reductions

reference

Implements the Reference type

repr

Provide the repr function

reversed

Provides the reversed function for reverse iteration over collections

set

Implements the Set datatype

simd

Implements SIMD struct

sort

Implements the built-in sort function

span

Implements the Span type

stat

Implements the stat module

static_tuple

Implements StaticTuple, a statically-sized uniform container

str

Provides the str function

string

Implements basic object methods for working with strings

string_literal

Implements the StringLiteral class

string_slice

Implements the StringSlice type

stringref

Implements the StringRef class

swap

Implements the built-in swap function

tensor

Implements the Tensor type

tensor_shape

Implements the TensorShape type

tensor_spec

Implements the TensorSpec type

terminate

This module includes the exit functions

testing

Implements various testing utils

time

Implements basic utils for working with time

tuple

Implements the Tuple type

type_aliases

Defines some type aliases

unsafe

Implements types that work with unsafe pointers

unsafe_pointer

Implement a generic unsafe pointer type

value

Defines core value traits

variant

Defines a Variant type

vector

Defines InlinedFixedVector