[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
10.1 Why C++ ?
Using C++ as an implementation language provides
- Efficiency: It compiles to machine code.
- Portability: It runs on all platforms supporting a C++ compiler. Because of the availability of GNU C++, this includes all currently used 32-bit and 64-bit platforms, independently of the quality of the vendor’s C++ compiler.
-
Type safety: The C++ compilers knows about the number types and complains if,
for example, you try to assign a float to an integer variable. However,
a drawback is that C++ doesn’t know about generic types, hence a restriction
like that
operator+ (const cl_MI&, const cl_MI&)
requires that both arguments belong to the same modular ring cannot be expressed as a compile-time information. -
Algebraic syntax: The elementary operations
+
,-
,*
,=
,==
, ... can be used in infix notation, which is more convenient than Lisp notation ‘(+ x y)’ or C notation ‘add(x,y,&z)’.
With these language features, there is no need for two separate languages, one for the implementation of the library and one in which the library’s users can program. This means that a prototype implementation of an algorithm can be integrated into the library immediately after it has been tested and debugged. No need to rewrite it in a low-level language after having prototyped in a high-level language.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on August 27, 2013 using texi2html 5.0.