Template regexes, version 2
Craig Black
cblack at ara.com
Tue Feb 21 08:42:39 PST 2006
> The mixin regexps are only at an early stage of development, but given the
> current discussions I think it's important to know what can be done
> with templates (probably more than most people expect). In the case of
> what I've called "pseudo-static" regexps, they are arguably more powerful
> than the built-in regexps of DMD 0.147.
>
> I don't know where to go from here. There are a few possibilities:
> 1. use template regexps as a demonstration of the power of D templates.
> --> Implement reduced syntax, keep the code simple and not well optimised;
> more of a proof-of-concept; go for "maximum coolness".
> 2. Like 1, but with optimisations; try to be the fastest regexp of any
> language. (cleaner-faster-better ... but we use the built-in regexps
> anyway <g>).
> 3. Create a standard library. This is what I was aiming for, but I don't
> think it makes sense any more.
> 4. potential integration into the language. Is this even possible?
>
> Probably the most sensible is to go with 1, to wake up the C++/boost
> crowd. Hopefully this should also provide some direction for the built-in
> syntax.
> Thoughts?
You are the man! Keep up the good work!
As far as what direction to go, a stardard library makes perfect sense. If
Walter's kludge for regex's doesn't fit with this new approach, perhaps he
can adapt it to make it work. Even without this, I would much rather have
faster regex's than language integration.
BTW, I developed a new syntax that is a spinoff of regular expressions
(using C++). It includes syntax to manipulate a stack and store values in a
parse tree. Using this language, I was able to define a parser for a modern
object-oriented language in like 230 lines of code. I could show you this
stuff if you are interested.
-Craig
More information about the Digitalmars-d
mailing list