C/C++ Users Journal January 2004

Editor's Forum

A Season of Change

The good news is that I spent over half the month of October in Hawaii. The bad news is that I missed the beauty of turning leaves back home in Concord, Massachusetts. And much of that time in paradise was spent in windowless rooms with my fellow Standards hacks. Still, I don't expect much sympathy. And a lot of good things happened, at least from my perspective, at both the C and C++ meetings.

Let's look at C first. The really good news is that the C committee has decided not to begin revising the C Standard (again) any time soon. C99 is fully implemented by only one front end, from Edison Design Group, and by only one library (ahem). Our joint customers are just beginning to get conforming products out the door. The C committee wisely decided that it would be prudent to wait for the world to catch up a bit. So the committee requested that SC22, its parent body within ISO, simply reaffirm the existing C Standard for another few years. And it did.

That doesn't mean that C is stagnating. The committee modus operandi these days is to develop non-normative technical reports (TRs) that address various specialized constituencies within the C community. Any of these TRs that become sufficiently popular then become useful prior art for the next normative revision of the C Standard. And meanwhile the community has a focused way to experiment with new features. (That's how the Numerical C Extensions Group ended up having so much influence on C99, by the way.) For example, the C committee has just finished up an Embedded TR that deals with fixed-point arithmetic, named address spaces, and I/O hardware addressing. Another TR adds 16- and 32-bit character types, in addition to the flexible wchar_t wide-character type, to better support UTF-16 and UCS-4 for the Unicode crowd.

Now the committee has begun three more TRs. One is based on a proposal from Microsoft to add a few dozen more-secure versions of existing Standard C library functions, mostly to make it easier for conscientious programmers to avoid buffer overruns. Another is based on a proposal from IBM to add support for the new packed decimal floating-point formats specified by IEEE 754R, a revision still under way by the old binary floating-point standard. And the third TR adds the same special math functions, such as Bessels and elliptic integrals, which C++ has already agreed to tackle with its first library TR (described below). I used to joke about adding Bessel functions and packed decimals to C as two examples of silly extremes. Now it looks like both are going to happen, and for sensible reasons even. I'll have to find something new to joke about.

The C++ committee has always been more adventuresome—and more inventive—than C. So you will not be surprised to learn that the Evolution subcommittee, under the stewardship of Bjarne Stroustrup himself, is picking up steam. But the good news once more is that the committee has learned the importance of backward compatibility. And it has decided to adopt all the new preprocessor features of C99, too. Work is indeed progressing on C++0X, the next revision of Standard C++, but I suspect it'll be several years before you'll have to worry much about significant new language features in C++.

Meanwhile, the committee has completed work on a Performance TR. It includes all but the fixed-point part of C's Embedded TR, plus a lot of advice for both implementers and users on how to get the most out of Standard C++. And we're well into that first library TR I mentioned earlier. It's a massive addition to the library, with everything from regular expression classes and heavy-duty random-number generators to a whole assortment of aids for template metaprogramming. It also incluldes those Bessels and other special math functions that C has agreed to pick up. Moreover, the C++ committee has, in turn, agreed to pick up all the extra library features that the C committee added with C99. It's a serious undertaking indeed.

Finally, the C++ committee has decided to begin a TR of its own on decimal floating-point math. But here's the really novel part—the C and C++ committees have agreed to work together on their parallel TRs to ensure that they are as compatible as possible. Yes, you've read it all right—C is picking up C++ library features, C++ is picking up things from both C99 and newer C TRs, and the committees are actively cooperating. And they said the two languages were drifting inexorably apart...

I missed the leaves, but it was fun to see that seasons can change even in Hawaii.