Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
rebar
A biased barometer for gauging the relative speed of some regex engines on a curated set of tasks.
I've never used cl-ppcre myself, but its docs[1] claim that it provides compile-time regexes:
> CL-PPCRE uses compiler macros to pre-compile scanners at load time if possible. This happens if the compiler can determine that the regular expression (no matter if it's a string or an S-expression) is constant at compile time and is intended to save the time for creating scanners at execution time (probably creating the same scanner over and over in a loop).
[1]: https://edicl.github.io/cl-ppcre/
I'd love for someone to add this to rebar[1] so that we can get a good sense of how well it does against other general purpose regex engines. It will be a little tricky to add (since the build step will require emitting a C++ program and compiling it), but it should be possible.
[1]: https://github.com/BurntSushi/rebar
Since other people are posting other lang implementations... someone did it for zig too (probably less polished than this C++ lib) [1]. It is nice that the regexes can be used at compile time too ().
--
: I think the difference between C++ template language and Zig comptime is that Zig's comptime is almost equal as Zig's regular language, whereas the experience of programming C++ templates almost feels like learning a separate, equally complex language.
1: https://github.com/alexnask/ctregex.zig