Skip to content

✨ feat(mq-lang): add sort_natural for numeric-aware natural sorting - #2103

Merged
harehare merged 1 commit into
mainfrom
feat/sort-natural
Jul 28, 2026
Merged

✨ feat(mq-lang): add sort_natural for numeric-aware natural sorting#2103
harehare merged 1 commit into
mainfrom
feat/sort-natural

Conversation

@harehare

Copy link
Copy Markdown
Owner

Summary

Sorts arrays so embedded digit runs compare numerically instead of lexicographically (e.g. "file2" before "file10"), similar to GNU sort -V. Implemented in builtin.mq on top of sort_by using scan/lpad, with type-checker registration in mq-check.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor
  • 📝 Documentation
  • ⚡ Performance
  • ✅ Test
  • 📦 Build / dependencies
  • 👷 CI

Checklist

  • I ran cargo fmt and cargo clippy and addressed any warnings
  • I ran just test-all and all tests pass
  • I added or updated tests covering this change
  • I updated relevant documentation (/docs, crate README.md) if needed
  • I added a changelog entry if this is a user-facing change

Additional Context

Sorts arrays so embedded digit runs compare numerically instead of
lexicographically (e.g. "file2" before "file10"), similar to GNU
sort -V. Implemented in builtin.mq on top of sort_by using scan/lpad,
with type-checker registration in mq-check.
@codspeed-hq

codspeed-hq Bot commented Jul 28, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 15.33%

⚡ 1 improved benchmark
✅ 30 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
eval_macro_expansion_simple 113 µs 98 µs +15.33%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing feat/sort-natural (af780da) with main (859437e)

Open in CodSpeed

@harehare
harehare merged commit 2683836 into main Jul 28, 2026
11 checks passed
@harehare
harehare deleted the feat/sort-natural branch July 28, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant