S
sandeep
I have been reading a very interesting interview with the creator and
maintainer of C++, Mr B Stroustrup: http://www.codeguru.com/cpp/misc/
article.php/c18357/An-Interview-with-C-Creator-Bjarne-Stroustrup.htm
In it he reveals that a new ISO standard for C++ will soon be available.
I believe this has many serious implications for ISO C. Here are some of
the main points.
===
I declared p without explicitly mentioning the type of p. Instead, I used
auto, which means "use the type of the initializer." So p is a
vector<pair<string,int>>::iterator. That saves a fair bit of typing and
removes the possibility of a few kinds of bugs. This is the oldest C++0x
feature; I implemented it in 1983, but was forced to take it out for C
compatibility reasons.
===
This is a major issue because auto is a keyword in C with a different
meaning! Recommendation: revise the semantics of auto in C to match C++.
So you could have:
auto fp = fopen("foo", "r"); /* fp will have type FILE*, not int */
Compilers will be able to provide switches like -traditional for legacy
code that uses auto in the old sense
===
Direct and type safe support for the traditional threads-and-locks style
of system-level concurrency. Together with a detailed memory model and
facilities for lock-free programming, this provides support for portable
and efficient concurrency.
===
Multithreading is the future - many-core processors are already becoming
the norm. Recommendation: C should follow the lead of C++ and standardize
multithreading in the same way.
===
A regular expression standard library component
===
Recommendation: Many programs use regular expressions, so this would be a
useful addition to C's standard library, again it should be done to
maintain compatibility with C++.
There are many other new things too, and I would advise all members of
the ISO C panel to think carefully about how to integrate the new
features of C++1x, into the next version of the ISO C standard.
maintainer of C++, Mr B Stroustrup: http://www.codeguru.com/cpp/misc/
article.php/c18357/An-Interview-with-C-Creator-Bjarne-Stroustrup.htm
In it he reveals that a new ISO standard for C++ will soon be available.
I believe this has many serious implications for ISO C. Here are some of
the main points.
===
I declared p without explicitly mentioning the type of p. Instead, I used
auto, which means "use the type of the initializer." So p is a
vector<pair<string,int>>::iterator. That saves a fair bit of typing and
removes the possibility of a few kinds of bugs. This is the oldest C++0x
feature; I implemented it in 1983, but was forced to take it out for C
compatibility reasons.
===
This is a major issue because auto is a keyword in C with a different
meaning! Recommendation: revise the semantics of auto in C to match C++.
So you could have:
auto fp = fopen("foo", "r"); /* fp will have type FILE*, not int */
Compilers will be able to provide switches like -traditional for legacy
code that uses auto in the old sense
===
Direct and type safe support for the traditional threads-and-locks style
of system-level concurrency. Together with a detailed memory model and
facilities for lock-free programming, this provides support for portable
and efficient concurrency.
===
Multithreading is the future - many-core processors are already becoming
the norm. Recommendation: C should follow the lead of C++ and standardize
multithreading in the same way.
===
A regular expression standard library component
===
Recommendation: Many programs use regular expressions, so this would be a
useful addition to C's standard library, again it should be done to
maintain compatibility with C++.
There are many other new things too, and I would advise all members of
the ISO C panel to think carefully about how to integrate the new
features of C++1x, into the next version of the ISO C standard.