Quote:What I tried to show are some inconsistencies of C++. Some type of work, like codecs, is better to do in Java (and use Java to exe optimizing computation guided compiler) than in C++.
>> is nice, however advanced languages have also >>> (shr).
Shift-right makes sense for primitive types, and for nothing else. Why, then, is it unnaceptable to recycle the operator for streams?
Quote:Until C++ would have defined different commands for sar and shr, it would be impossible to use some types of branch-less optimizations.
Such as?
Quote:Things are even worse behavior of >> is undefined.
You are missing either a comma and a 'the', or 'if'. In either case... the behavior of operator>> is well defined. If you write a custom one that has undefined behavior, well, that's hardly the language's fault.
Quote:Definition of exact size in bits for all standard data types is surprisingly still not part of specification. Reason? Only plausible reason might be legacy code, this is however a somehow bad reason if people are not happy with typing sizeof... sizeof... size you know. Other reason? Lot of programmers would need to learn new things, all old source code would need an PRAGMA oldC in its header files. On the other hand majority of smart C++ compilers might believe - if programmer didn't used sizeOf he expected an int to be a 32 bit data type.
Actually, the size of primitives are very well defined. An int, for example, is atleast the size of a machine word. A short is at most the size of an int, and a char is at most the size of a short. You probably won't believe me, or will offer some other excuse, but not all systems have the same size words. A lot of embedded systems are still 16 or even 8 bit. If the size of int was guaranteed to be 32 bits, you would have to write different code for different platforms, or suffer performance penalties. 32 bit integers are slower than their 64 bit counterparts on many 64 bit systems, especially when alignment is considered.
Quote:
Of course compiler Dependant compiling is also a possibility. Use int64 and hope the compiler would know what it is.
First, 'compiler dependant compiling'? Second, what the hell does an int64 type have to do with
Quote: However with this approach, even Java could have template (compiler time) meta programming, and operator overloading.
I just don't see the connection.
Quote:
What I missed? Multithreading support and a memory model. Lack of build in thread library and papers about how should compiled code work on multicore system in heavily multithreaded environment is astonishing.
It has a 'memory model'. Threading is a property of the platform. Surprisingly enough, the vast majority of computers out there AREN'T running a task-sharing operating system. And there is a vast library of papers multi-threading. Most of them are language-agnostic. Nor does the presence or absence of multi-threading have any effect on the generated code.
Quote:Actually C++ doesn't miss only build in tread library, it misses also build in image, sound, input, and window libraries, thus enforces the "we all like a command line" behavior.
Again, those are all properties
of the platform. It is the lack of these things in the C++ standard library that makes it portable. These services are all platform specific, and are supplied by platform specific libraries. Also, are you suggesting that C++ can only be used for command line applications? That's absurd.
Quote:
Of course some problems are mitigated, slowly. It seems the C++ would become something like superset of the Java standard 1.0 .
Actually, it seems to be the other way around.
Quote:BTW I never said a programmer should handle registers, even in ASM this could be optional. My complain was about impossibility of easy and clear implementation of some algorithms, without using ASM.
An example?
Quote: IMO standard data types should be virtual registers in the same way arrays are virtual representation of the memory.
No. The compiler is much better equiped to make effecient use of registers than the programmer is.
Quote:
Yes you can trust the compiler to create incredible bugs for you, or change behind the scenes algorithm to make you program crawl,
[rolleyes]
Quote:however the better behavior is try to verify the resulting binary. Hopefully current compilers are smart enough to don't use "a - a" as reason why remove all error cancellation from the algorithm.
A minus A? Error cancellation?