r/ProgrammingLanguages • u/Purp1eGh0st • Apr 04 '26
Post-Penultimate Conditional Syntax
https://joel.place/blog/conditionals/In fleshing out conditional control flow syntax for my language, I wanted something expressive (read: pattern-matching), but didn't like how that led so many languages to have a divergence between if-style and match-style conditionals.
After taking some inspiration from Ultimate Conditional Syntax and playing around for a bit, I've landed on a form of exhaustive binding if statements that feels to me very much like it falls out naturally from existing work, and so should not be novel, but I can't easily find elsewhere.
Does anyone know of existing languages that use similar syntax and I can look to for inspiration/battle-testing, or see obvious holes in this construction that would have prevented others from using it? Thanks in advance!
View all comments
Show parent comment
3
u/Purp1eGh0st Apr 05 '26
Oh interesting! I'll have to to sit down properly to fully grok the paper, but from briefly skimming it seems like they find ways to extend
matchwith a proper algebra - sort of equivalent to what I'm trying to do withif, but if they can do it well that maybe is a more powerful starting point? I'll admit to tending to write morematchthanifstatements in most of my code after all. Thanks!And yeah,
andandorare indeed just the short-circuiting boolean operators. I was only trying to spell out the implications for their interactions withisclearly :)