Skip to content

ExtraMojo/ExtraMojo

Repository files navigation

⚡ extramojo ⚡

Extra functionality to extend the Mojo std lib.

Supports mojo 25.5.0

Documentation and Examples

ExtraMojo Docs

Also see any of the tests in the test_*.mojo files.

Install / Usage

Add https://repo.prefix.dev/modular-community to your project channels:

# mojoproject.toml or pixi.toml

[project]
channels = ["conda-forge", "https://conda.modular.com/max", "https://repo.prefix.dev/modular-community"]
description = "Add a short description here"
name = "my-mojo-project"
platforms = ["osx-arm64"]
version = "0.1.0"

[tasks]

[dependencies]
mojo = "=25.5.0"

then run:

pixi add extramojo

Or directly by following these instructions.

See docs for numojo and just do that for this package until Mojo has true package / library support.

tl;dr;

In your project mojo run -I "../extramojo" my_example_file.mojo. Note the bit about how to add this project to your LSP so things resolve in VSCode.

Notable Functionality

  • Buffered Reading and writing for files
  • CLI opts parser
  • For bytestrings (List/Span[UInt8]), SIMD version of: memchr, to_uppercase, to_lowercase, SplitIterator
  • BBHash
  • BitVec
  • saturating_add and saturating_sub for integral types
  • reservoir sampling

See docs for details

Tasks

magic run test
magic run format
magic run build

Attribution

  • Much of the first draft of the File and Tensor code was taken from here, which has now moved here.

About

A library of nice to have things not found in the current mojo stdlib

Resources

License

Unlicense, MIT licenses found

Licenses found

Unlicense
UNLICENSE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages