News for hackers. Stuff that matters.
Re:Melody – a language that compiles to regular expressions by yoav_lavi on Wednesday February 16, 2022 @10:46AM (#30361483)
Author here, thanks for posting Melody! This is my first attempt at a language and I'm learning Rust, so any input would be appreciated
Re:Melody – a language that compiles to regular expressions by fouc on Wednesday February 16, 2022 @09:48PM (#30368982)
Minor comment.. I personally find it harder to type < > than : because the < > keys are a lot closer to the shift key and causes more wrist strain.

Have you considered borrowing the :emoji: convention that slack/discord/github use? :space: :feed: etc..

Re:Melody – a language that compiles to regular expressions by fire on Thursday February 17, 2022 @12:31AM (#30369853)
( not OP and not disregarding the issue at hand ) have you tried practicing usage of the shift key opposite the key you want to press? Learning to make that change was hard for me, but is one or if not the largest improvement for me over the years in both typing speed and general typing comfort
Re:Melody – a language that compiles to regular expressions by zdragnar on Thursday February 17, 2022 @12:32AM (#30369855)
Assuming a standard QWERTY layout, shouldn't you be using the left shift when typing < or >? It'll significantly reduce the contortion effort in your right hand. Same goes for most chords- use opposing hands for the modifier and symbol keys.

(Oddly enough, I don't bother doing this with ctrl/cmd + a/s/f/z/x/c/v, but I think that is mostly because keys to the right of the space bar vary so much between laptops and keyboards that I never bothered trying to stick with it).

Re:Melody – a language that compiles to regular expressions by dotancohen on Thursday February 17, 2022 @06:56AM (#30372159)
Hello Yoav! In my opinion the match keyword is not needed. When the parser gets to an opening bracket that should start whatever methodology the match keyword is doing. As a heavy regex user, I understand that you want consistency with the capture keyword behaviour. But if we assume that the user is a programmer but does not know regex, it makes more sense to view {<space>;"batman";} as an array (delimited by curly brackets).

In fact, you might want to go a step further and consider using [] for match and {} for capture (thus eliminating the capture keyword as well). Using [] for match would be natural for Javascript programmers.

Re:Melody – a language that compiles to regular expressions by dokem on Wednesday February 16, 2022 @01:17PM (#30363542)
I feel like there should be a way to group a portion of the regex, by name, for extraction later. Otherwise I like it.

ie

    group $first_name { some of <letter> }
    1 of <space>
    group $last_name { some of <letter> }
Re:Melody – a language that compiles to regular expressions by ozzmotik on Wednesday February 16, 2022 @06:48PM (#30367512)
capture name {} is a thing it listed