News for hackers. Stuff that matters.

Melody – A readable language that compiles to regular expressions

Melody was posted here (not by myself), but the project was still in very early stages, and so I wanted to post an update that Melody now has:

- A Babel plugin - https://www.npmjs.com/package/babel-plugin-melody

- NodeJS bindings via WASM - https://www.npmjs.com/package/melodyc

- A playground - https://melody-playground.vercel.app/

- VSCode and JetBrains extensions - https://marketplace.visualstudio.com/items?itemName=yoavlavi.melody https://plugins.jetbrains.com/plugin/18693-melody

- A CLI and REPL

- A documentation book - https://yoav-lavi.github.io/melody/book/

The idea behind Melody is to represent regular expressions in a readable, maintainable format that plays nicely with larger projects, multiple people, diffs and so forth, while adding some QOL features.

See the repository here: https://github.com/yoav-lavi/melody

( 3 comments | 5 points | on HN )
Re:Melody – A readable language that compiles to regular exp... by atarikraken on Monday April 04, 2022 @01:06PM (#30909104)
I like innovation, and I'm all for making programming easier.

That said, from the example documentation.. <start>;

option of "v";

capture major { some of <digit>; }

".";

capture minor { some of <digit>; }

".";

capture patch { some of <digit>; }

<end>;

// v1.0.0

Show that to someone who isn't familiar with regex, and they'll have no idea what it means.

Someone who is familiar with regex, will likely prefer the regex format.

Re:Melody – A readable language that compiles to regular exp... by beardyw on Monday April 04, 2022 @02:24PM (#30910224)
I can see the value of this but I worry that the implementation of support for it has rushed ahead of what "it" is. To be successful I think a formal definition of how say 90% of regex expressions would be represented should be created and reviewed.
Re:Melody – A readable language that compiles to regular exp... by PaulHoule on Monday April 04, 2022 @01:02PM (#30909057)
None of these links work when you submit them in question text.

It's better to just submit links as links.