In a recent article Bjarne Stroustrup presented the evolution of C++ toward the 0X standard, and asked the C++ community for ideas regarding C++ enhancements. This is a proposal to add to C++ support for using packaged libraries, and a standardizing a library distribution format.
Consider a typical list of enhancements to the C++ libraries. Such a list could contain: a matrix data type, a graph data structure, image manipulation classes, a networking API, cryptography, GUI programming, sound processing, compression, a currency data type, and an arbitrary precision arithmetic library. We can then generalize this list into the following requirement: provide all useful elements available in the union of the Java 5 platform, Perl's CPAN modules, the PHP libraries, and so on. Of course, neither the initial list, nor its generalization stand much chance to affect C++0X. A more realistic solution would be to provide a platform for adding these facilities, and then leveraging the work of the open source community (like Boost) for the actual library implementations.
There are two requirements for providing the C++ community with a successful library repository: the standardization of the library distribution format, and some minimal support for using packaged libraries in C++ programs.
The standardization of the library distribution format should address the following issues:
The linguistic support for using a packaged library in a program should be minimal. A preprocessor directive like
#import libraryname [version-specification]
should be enough. The directive would make available to the compilation
unit the facilities of the named library, and arrange for the library code
to be linked with the final executable image. It is up to the specific
C++ implementation to compile the library's source code to ensure ABI
compatibility with the rest of the program, cache compiled versions of
the libraries, and utilize shared library facilities where available.
The optional version-specification element of the directive could be a
list or a range of library versions that the specific compilation unit
can work with. It would be reasonable to restrict each linkage unit to
the use of a single version of a library.
Comments
Post
Toot!
Tweet
Last modified: Wednesday, July 20, 2005 1:19 pm
Unless otherwise expressly stated, all original material on this page created by Diomidis Spinellis is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.