Christopher Lemmer Webber is a user on octodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.

boost for

(cat|girl|gay|boob|shark|emoj(i|o)|gargr?(on|amel))s?

hello i'm one of the seven (7) people in the world who apparently enjoys writing regular expressions enough to shitpost about it

@kellerfuchs @CobaltVelvet I enjoy complaining about how much better regular expressions could be if they were composable, ie synthcode.com/scheme/irregex/ (see also more-magic.net/posts/lispy-dsl and for why regexes aren't composable (read "stringly typed systems") see groups.csail.mit.edu/mac/users )

@cwebber @CobaltVelvet
Yes, that's why embedding regexps in your language (i.e. having regexps as values and operators on them, as in github.com/ocaml/ocaml-re/blob) is so much nicer :)

@kellerfuchs @CobaltVelvet Those look nice! Yes, non-stringly-typed actually-composable regexps is what the world wants but what most of us day to day don't get to have!

Christopher Lemmer Webber @cwebber

@CobaltVelvet @kellerfuchs fun fact I wrote the parser for Mudsync using irregex and it was a delight (but not super fast)

lambda, the ultimate regex engine!

· Web · 0 · 0

@cwebber
That's a pity (that irregex isn't fast).

FWIW, ocaml-re uses pretty simple automata techniques; IIRC, it lazily constructs a DFA, using Brsosowski's derivative to lazily build a NFA and “then” lazily determinizing.
There is no obvious reason this can't be done in Scheme too. :)

@kellerfuchs tbh I think it *could* be faster, without rewriting irregex at all already, if Guile gets a JIT or AoT compilation (which it looks like it will)

@kellerfuchs but the method you suggested sounds appealing :)

@cwebber “make the runtime faster so my library isn't as slow” sounds like something I would do.
(In that case, the two gains are likely complimentary)