GitHub - yoav-lavi/melody: Melody is a language that compiles to regular expressions and aims to be more easily readable and maintainable
github.com
external-link
Melody is a language that compiles to regular expressions and aims to be more easily readable and maintainable - GitHub - yoav-lavi/melody: Melody is a language that compiles to regular expressions...
@custom_situation@lemm.ee
link
fedilink
English
6
edit-2
1Y

i mean, you can learn the basics of matching in 30 minutes or less. that core knowledge will be broadly applicable across any tool that uses regex. things get much easier once to have a handle on the basics.

…or you can learn this regex dsl and still have to learn regex. the difference is you’re learning a non-portable regex syntax.

@IronDonkey@lemmy.world
link
fedilink
English
51Y

You’re right, I can learn the basics of regex in 30 minutes. Then I can write my one regex. Then I can forget the basics of regex in 3 minutes, because regex’s syntax is random garbage that makes no intuitive sense, and I hate and suck at memorizing nonsense. Repeat every 4-16 months.

It’s true though that regex is entrenched enough that even if something is easier to read, it’s unlikely that it’ll replace regex any time soon. You’d need a couple big names to adopt it, then many years.

But if there’s a readable replacement that can convert to and from regex - well, screw it, I’m in. Even if I’m required to use regex in some program, if I can write something that makes sense without the requisite half hour of googling crap, I’ll just use it as a separate tool to make and read regex strings.

@realitista@lemm.ee
link
fedilink
English
21Y

Probably I’ve spent the 30 minutes 5-10 times over my life. But then it’s a few years till I need it again and I need to spend the 30 minutes again.

@Kempeth@feddit.de
link
fedilink
English
61Y

Sure. I just very rarely need just basic regexes.

And once you go beyond these the syntax gets very obtuse. Which means I’m spending an hour+ googling something close to what I need and then using a sandbox to try and tweak it until it does what I need. Then I paste something into my code that I won’t understand anymore 5 minutes into the future - which isn’t exactly great for maintainability.

@realitista@lemm.ee
link
fedilink
English
31Y

This is a good point too. Just because you don’t use regex often doesn’t mean your needs are simple. They are probably much the same as someone who uses it often. Which is why readability and less learning curve is a good thing.

fair!

Create a post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



  • 1 user online
  • 1 user / day
  • 1 user / week
  • 1 user / month
  • 1.11K users / 6 months
  • 1 subscriber
  • 1.21K Posts
  • 17.8K Comments
  • Modlog