From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2002-10-24 18:48:24
"David Abrahams" <dave_at_[hidden]> wrote in message
> Now wait a second. If you try to roll your own regular expression
> interpreter, you're almost certainly going to either get it wrong or
> make something much bigger than the implementations John and Eric have
> been refining for years, or both. If you just need a "simpler parser",
> then maybe you /should/ be using different tools. Anyone who has
> studied regexps for 5 minutes knows they're not exactly "simple", and
> are in fact inappropriate for lots of structural parsing jobs (even
> such things as parsing simple arithmetic expressions). Regexps are
> really aimed at a different kind of textual analysis, and provide a
> great deal of power in the domain in which they're appropriate.
This is a sequence of correct statements, but I fail to understand how they
relate to what I'm describing. What I'm saying is:
1. Someone has some task to do in a program, for which a regex would help.
For example, parsing a date and time, a file format, etc.
2. They look around and say, here, I found two nice packages.
3. They link in the packages and notice a steep increase in size (this
assertion subject to be corrected by incoming measurements).
4. They say, wow, that's too much for what I need. Let me then do some
find() and at() and figure things out by hand.
> In particular, if I was parsing my tax data, and if regexps were up to
> the job, I'd pick the library first.
I chose awk :oD.
Hopefully a test with char* only will show that only a small part of the
library will be linked in. If we're talking about hundreds of KBs, that's a
lot. Many programmers in circles I frequent would consider that too much.
Those can't be simply tuned out of existence.
-- All new! THE C++ Seminar: Oct. 28-30 in Vancouver, WA. http://www.thecppseminar.com/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk