‘Thoughts’ are a place for me to write down random ideas that I think are interesting. They might be of any length, discuss any topic, and will probably not be formal, scientific, or rigorous in presentation.

They are also, in some sense, a way for me to connect with interesting people, so if something here piques your interest or you have some comments to make, please do reach out! (omar at bloeys dot com)

Edit: This thought led to the creation of Regexl.

Imagine an expert assembly programmer, spending his days writing mnemonics and working with addresses and jumping to labels. To him, all this feels normal and he has no complaints about what he does. It’s true the exploding number of instructions make his programs progressively harder to understand, but that’s normal for his line of work.

Next to him sits his friend, coding in a high level language, where 10 lines of (almost natural language looking) code might equal 100 assembly instructions. Not only is the code much shorter, but the expressiveness of the language makes it easier to understand and lowers the barrier to entry compared to assembly.

It seems to me that the way we write regex today is akin to writing assembly, weird symbols that don’t convey their meaning (assembly mnemonics carry more meaning!), special knowledge required to write them, and they become hard to understand so quickly that the usage of regex is sometimes discouraged.

A powerful tool held back by a bad interface. It’s odd that the programming community has not produced (at least none that I saw) a serious, feature complete, high-level language that can be used to write regex. There is no reason regex code can’t be as ’normal’, accessible, and expressive as C/Go/Java/etc.

Sure it will be longer, but since when is writing all your code in one line a good idea?