Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2002-10-24 00:58:59

"Edward Diener" <eddielee_at_[hidden]> wrote in message
> I would suggest that you ask Dr. John Maddock who wrote it further about
> design.

Well it's implied that questions on this forum are directed to everybody.

>I am not the designer although I have used it successfully in my own
> Regular Expression Component Library (
> . Much of the
> underlying Regex++ functionality exists in a library because instantiating
> such code via templates each and every time would really lead to code
> At least a library allows one to fold common code together.

I'm not sure I understand. What would "each and every time" mean. Wouldn't
the linker eliminate duplicate functions, if any?

> > cvs.exe: 239 KB
> > efaxview.exe (fax viewer): 337 KB
> > kazaa.exe: 2,258 KB
> > msmsgs.exe (MS Messenger): 1,477 KB
> > stocks.exe (Medved QuoteTracker): 4,642 KB
> > wincvs.exe: 733 KB
> >
> > I believe I compressed some or all of these programs with upx, but if
> > double the numbers, my point stays the same.
> >
> > Consider a 3 MB executable, would that be enough? If what my program
> is
> > ***all about*** regular expressions, ok, I grudgingly agree on having a
> > regex engine add 17% size to it.
> >
> > If that program has only incidental use for regular expressions (as
> be
> > the case with either of the above programs), such as validating some
> > input or parsing some protocol or parsing some file format, then no way
> > we're talking about "pretty small". No way.
> I guess I don't understand the issue regarding size per se. Unless one is
> programming embedded systems nowadays it practically doesn't seem to
> Of course I understand designing something well so that extraneous code or
> code duplication doesn't occur, and I enjoy as much as the next programmer
> designing something elegant, creative, and beautiful. But just as in a
> well known area, size matters much less than people think and creativity
> what counts.

Nowadays speed depends on size because of the increasing gap between
processor and memory and the crucial importance of cache. Second, download
duration is a factor with many applications.

I have worked very recently on systems where size was a BIG issue (and still
is). They are commonly used desktop applications that you might have
installed (and perhaps even running) on your machine right now. Those
systems could have used regexps on occasion. Adding a 500 KB package for
doing that would be risible.

Indeed, size is not of crucial importance, however 500 KB today is big
enough to be non-negligible. The regular expression engines must lose one
order of magnitude in size t be compelling. I understand that that's
entirely doable.

By the way, I think regexps are an essential addition to the standard. It's
practically what forces many to work in Perl rather in C++. The current
perception is that when it comes about string manipulation and I/O, C++ is
primitive and arcane.


All new!  THE C++ Seminar: Oct. 28-30 in Vancouver, WA.

Boost list run by bdawes at, gregod at, cpdaniel at, john at