r/rust•
Ok_Main_8544

I wrote a tiny DSL for lead sheets in Rust, looking for feedback on the parser and design

Hey everyone, new account here, but not new to Rust.
I’ve been experimenting with a small side project the past few days and wanted to share it to get some feedback from people who enjoy parsers, DSLs, and music-tech.

What it is

LeadSheetML is a minimal domain-specific language for writing lead sheets (chords + lyrics + sections). Internally it uses:

  • pest (PEG grammar)
  • an AST + internal representation
  • a transposer
  • a pluggable rendering engine for simple, generic markup (Markdown / HTML, extendable)
  • a small VS Code extension with syntax highlighting

It’s early-stage, but fully functional.

What I’d love feedback on

Mainly Rust-side impressions:

  • does the AST structure look idiomatic?
  • how’s the crate layout?
  • is the separation between leadsheetml and markup_engine sensible?
  • any major “code smell” spots?
  • anything that would make publishing as crates smoother?

Known issue

The transposer currently favors flats (Gb/Db/etc).
Musically valid, but not ideal spelling. This is the next fix, but I wanted to release v0.0.1 to start getting feedback.

Open source

MIT license, feel free to tinker, critique, fork, or break it.

Links

GitHub:
https://github.com/omnomchomsky/leadsheetml
https://github.com/omnomchomsky/markup_engine/

VS Code extension (syntax highlighting):
https://marketplace.visualstudio.com/items?itemName=omnomchomsky.leadsheetml-syntax-highlighting

Thanks for taking a look.

Screenshot:

VS Code highlighting (free in marketplace):

https://preview.redd.it/pqxqp9ksbi4g1.png?width=1206&format=png&auto=webp&s=73d41e4faf468f0bbb18007009af1733a4f5ba4e

Posted Dec 1, 2025, 2:58 AM UTC

1111
Loading comments…