Skip to content

mojo-struct v0.1.1

Choose a tag to compare

@amarbarosys amarbarosys released this 26 Nov 03:56
· 40 commits to main since this release

mojo-struct v0.1.1

Released: 2026-11-22 · Commit: tag struct-v0.1.1 · Previous: v0.1.0

What it does

Pack and unpack binary data in Mojo the way CPython 3.14 struct does. Install with pixi add mojo-struct
from the amarbaro/amarbaro prefix.dev channel.

Highlights

  • unpack_from_into unpacks into a list you already own, so a loop over records does not allocate a list per record.
  • This is the first release from the monorepo (amarbaro/mojo-libs, libs/struct).

Changes

Added

  • Struct.unpack_from_into(buf, offset, out).

Changed

  • Byte-swapped fields load a whole word and then swap it, instead of reading byte by byte.

Verified

Check Result
rattler-build build -r libs/struct/recipe.yaml (the recipe test builds the quickstart) PASS, 260.5 KiB .conda

Known limits

  • No speed numbers for this change are published here.

Upgrade / run

pixi add mojo-struct

Commits

  • 510b5be perf(struct): unpack_from_into and byte_swap word loads
  • cbcdcad feat(conda): struct recipe 0.1.1; xmojo package name mojo-xmojo