Metaprogramming and regular expressions
2025-10-27 20:40:37.997391+01 by Dan Lyke 0 comments
I've been fumbling around new languages. The last time I updated my C++ was for, I dunno, 11 or 17 or something. I've done some template programming, and some optimizations, and my static site generator is written in that framework. I kinda thought that if I could build myself a set of libraries and abstractions for the things I most wanted to do for hobby projects I'd do more with it, but the ugliness of Boost changes and the horrors of trying to compile with the same libraries on Mac and Linux, even with CMake, mean I don't do as much hobby coding in it as I expected.
Not that I've been doing a lot of hobby coding.
I've gotten pretty handy at Objective-C, but it's a language with a lot of baked in inefficiency and weirdness that makes it something I'll use, but not something I'm like "oh, yeah, I wanna do more in this". A coworker is leaning in to Swift pretty hard, but that's like "what if we pulled all of the good concepts out of Objective-C".
I've bounced off of Rust, but there's a whole lot about the philosophy of that tooling that makes it hard to have it feel like an expressive language. It's like trying to code through an isolation box, or with tele-operation, having to do all of the memory management through indexes into arrays and stuff. Like, I get it, but I think it's possible to build a systems language that lets me express and figures out the details for me, rather than binding me to only very safe things.
Evan Ovadia: The Impossible Optimization, and the Metaprogramming To Achieve It (Via) talks about using Mojo to resolve regular expressions at compile time, and that's some pretty cool stuff.
And that via link above eventually leads to Russ Cox — Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby, ...) all of which is a reminder that it'd be fun to get back to my language and parsing stuff expanding on the parser/language/thing I built for work, because finding better ways for us to express ourselves to computers is cool.