The only one I've seen is this one: https://parsy.readthedocs.io/en/latest/tutorial.html
1: https://github.com/massung/parse
2: https://wiki.call-cc.org/eggref/5/comparse
5: https://www.gnu.org/software/guile/manual/html_node/PEG-Pars...
A DSL that is a string, while having some downsides, does not have the arbitrary limitations of the "host" language. Either approach has its pros an cons.
It's the tooling aspect that's my gripe with it in a string really, it makes it less likely (and more editor-specific) that I can have syntax highlighting, LSP, etc. That's incidentally the only way in which I don't prefer SQL to Django ORM - i.e. it really isn't that it's a DSL (SQL) that bothers me, it's the string.
But hopefully obviously it's not a big deal, I was just surprised at the look of it when I saw it described as 'really nice' and that the project describes itself as 'focussed on ergonomics'. It just doesn't seem brilliant to me, fine perhaps, par for the course apparently, but not remarkable.
There may be some post parsing validation that can be done here- but that would be something that's beyond the domain of the parser.
The rationale is that it's more terse and has less visual clutter than a DSL over Python, which makes it easier to read and write.
Even a dict with expected keys and construction via the bitwise or operator (which would roughly match the form of a lot of the grammar) would be better wouldn't it? Imports could be imports, just mixed in somehow.
This is just first thoughts at a glance, maybe I'm missing something.