Skip to content

Conversation

@Mjboothaus
Copy link

@Mjboothaus Mjboothaus commented Jan 7, 2026

Add mojo-toml v0.5.0 - TOML 1.0 Complete + Partial 1.1

Adds mojo-toml - a native TOML parser and writer for Mojo with zero Python dependencies.

Features

TOML 1.0 - Fully Compliant:

  • ✅ Complete TOML 1.0 specification support
  • ✅ Array of tables [[section]] syntax
  • ✅ Alternative number bases (hex 0xDEAD, octal 0o755, binary 0b1101)
  • ✅ Nested tables, dotted keys, duplicate detection
  • ✅ TOML writer with round-trip fidelity
  • ✅ 168 comprehensive tests (127 parser + 41 writer)
  • ✅ Clear error messages with line/column context

TOML 1.1 - Partial Support:

  • \xHH escape sequences (codepoints 0-255)
  • \e escape for escape character

Performance:

  • Real-world config files: ~2ms parse time
  • Simple documents: 40K+ parses/sec
  • Comprehensive benchmark system with machine info reporting

Repository

Testing

Package includes test_package.mojo which validates:

  • Simple key-value parsing
  • Integer, float, boolean, and array parsing
  • Nested table structures
  • Dotted key functionality
  • Round-trip serialization

All 168 tests pass in the source repository.

Installation

Users can install via:

git submodule add https://github.com/databooth/mojo-toml vendor/mojo-toml
mojo -I vendor/mojo-toml/src your_app.mojo

Or via modular-community once merged:

pixi add mojo-toml

Sponsored by DataBooth - Building high-performance data and AI services with Mojo

Package: mojo-toml v0.3.0

A native TOML 1.0 parser for Mojo with zero Python dependencies.

Features:
- Complete TOML 1.0 syntax support
- 96 comprehensive tests ensuring reliability
- Nested tables, dotted keys, duplicate detection
- Clear error messages with line/column context
- Performance: 26μs for simple parses, 2ms for real files

Repository:
- GitHub: https://github.com/DataBooth/mojo-toml
- Release: https://github.com/DataBooth/mojo-toml/releases/tag/v0.3.0
- License: MIT

Testing:
Package includes test_package.mojo which validates:
- Simple key-value parsing
- Integer and array parsing
- Nested table structures
- Dotted key functionality

All 96 tests pass in the source repository.

Sponsored by DataBooth (https://www.databooth.com.au/posts/mojo)
@Mjboothaus
Copy link
Author

v 0.5.0 has now been released

@Mjboothaus
Copy link
Author

Mjboothaus commented Jan 12, 2026

I have fixed the pre-commit issues and re-submitted. Please note that v 0.5.0 is the latest release of mojo-toml.

@Mjboothaus
Copy link
Author

Hi @bgreni! 👋

Apologies for the confusion with this PR - I'm still learning the GitHub PR workflow! I've (hopefully) now updated everything properly:

What I've done:

Fixed pre-commit hooks - All checks now pass (trailing whitespace, end-of-file)
Updated to v0.5.0 - The recipe now points to the latest release (was v0.3.0)
Updated description - Reflects current features and test count

Changes since original PR (v0.3.0 → v0.5.0):

  • TOML 1.0 Complete: Array-of-tables [[section]], alternative number bases (hex/octal/binary)
  • Partial TOML 1.1: \xHH and \e escape sequences
  • 168 tests (up from 96) - 127 parser + 41 writer
  • Comprehensive benchmarking system with machine info reporting
  • Performance: ~2ms for real-world config files, 40K+ parses/sec for simple docs

Links:

The package is significantly more feature-complete now than when I first submitted the PR. All tests pass, pre-commit hooks pass, and it's ready for review!

Let me know if you need anything else or if I've messed up the PR workflow again. 😅 Thanks for your patience!

@Mjboothaus Mjboothaus changed the title Add mojo-toml v0.3.0 - Native TOML parser Add mojo-toml v0.5.0 - Native TOML parser & writer Jan 12, 2026
@bgreni
Copy link
Collaborator

bgreni commented Jan 23, 2026

Hey sorry for the wait, reviewing these packages seems to be a largely community driven effort at the moment, and I've been fairly busy as of late. Could you please add an image file to be displayed on the max builds website?

ex: https://github.com/modular/modular-community/blob/main/recipes/decimojo/image.jpeg

We also ask that you enabled CodeQL scanning on your repository and add the badge to you README https://docs.github.com/en/code-security/concepts/code-scanning/codeql/about-code-scanning-with-codeql

@Mjboothaus
Copy link
Author

@bgreni I've addressed both requests:

  1. Package image added - Created a TOML-themed logo as image.png (512×512 PNG) in the repository root for builds.modular.com display.

  2. CodeQL enabled and badge added - Enabled CodeQL scanning in repository settings and added the badge to README.md. The scan has been triggered and is running.

    • Badge: CodeQL

Both changes are now live in the main branch. Ready for re-review/merge. Thank you!

@Mjboothaus
Copy link
Author

Closing this PR in favor of a fresh PR with version 0.5.1.

The original PR was based on an older branch structure and was causing issues with displaying the newly added package image.

Changes in new PR (coming next):

  • ✅ Package image added (recipes/mojo-toml/image.png) for builds.modular.com display
  • ✅ CodeQL scanning enabled with badge in README
  • ✅ Version bumped to 0.5.1 to demarkate this updated release

Thank you for the review feedback @bgreni

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants