Skip to main content

Mojo package

utils

General utils: indexing, variants, static tuples, and thread synchronization.

The utils package provides foundational data structures and utilities used throughout the Mojo standard library. It includes types for multi-dimensional indexing, type-safe unions, fixed-size tuples, and thread synchronization primitives. These tools solve common programming patterns that don't fit neatly into other stdlib packages.

Use this package when you need low-level building blocks for data structures, generic programming with sum types, or fine-grained control over threading and indexing operations.

Modules

  • fast_div: Implements the fast division algorithm.
  • index: Implements IndexList which is commonly used to represent N-D indices.
  • lock: Implements thread synchronization primitives including spin locks.
  • numerics: Defines utilities to work with numeric types.
  • static_tuple: Implements StaticTuple, a statically-sized uniform container.
  • variant: Defines a Variant type.

Was this page helpful?