Skip to main content

Mojo🔥 modules

These are all the modules in the Mojo standard library.

anypointer

Implement a generic unsafe pointer type

anytype

Defines the AnyType trait

arg

Implements functions and variables for interacting with execution and system environment

atomic

Implements the Atomic class

autotuning

Implements the autotune functionality

base64

Provides functions for base64 encoding strings

benchmark

Implements the benchmark module for runtime benchmarking

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

compiler

complex

Implements the Complex type

constrained

Implements compile time contraints

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

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

inlined_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

limit

Provides interfaces to query numeric various numeric properties of types

list

Defines the List type

list

Provides utilities for working with static and variadic lists

loop

Implements higher-order functions

math

Defines math utilities

memory

Defines functions for memory manipulations

memory

Implements parallel_memcpy

memory

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

Implements the os

pathlike

Implements PathLike trait

polynomial

Provides two implementations for evaluating polynomials

python

Implements Python interoperability

random

random

Provides functions for random numbers

range

Implements a 'range' call

rebind

Implements type rebind

reduction

Implements SIMD reductions

set

Implements the Set datatype

simd

Implements SIMD struct

sort

Implements sorting functions

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

stringref

Implements the StringRef class

swap

Implements the swap function

tensor

Implements the Tensor type

tensor_shape

Implements the TensorShape type

tensor_spec

Implements the TensorSpec type

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 classes for working with unsafe pointers

value

Defines core value traits

variant

Defines a Variant type

vector

Defines InlinedFixedVector