Mabden wrote:
There is that. C# is VB.Net is Cobol.Net is Perl.Net is ... Your program
is "compiled" to a byte-code version that run on a virtual machine.
Sound familiar? C# is just one of the many "faces" that you can use.
Basically, they can add a new language anytime, I think Python is
coming, or may be here already. The first ones were VB and C#. I know
with C# you can still create a standard EXE, as well.
Or in other words, all languages have the same API. However C++ will
have more.
According to MS people, there will be more generics abilities available
to C++ than in other languages, and also C++ (with C++/CLI) is "correct
by default", while the other languages are "correct by explicit coding":
Deterministic destruction with objects in the stack, automatic compiler
creation of Dispose() including chaining calls to Dispose etc.
Consider also C++ templates, and what will be supported in the after
2005 version of VC++, objects of managed types in the unmanaged heap,
objects of unmanaged types in the managed heap, free mixing of managed
and unmanaged types, managed types inheriting from unmanaged types,
unmanaged types inheriting from managed types and various such
combinations, only available to C++.
Being vendor specific, VC++ 2005 will also provide OpenMP version 2
multithreading support (which you can download from
http://www.openmp.org) in addition to the standard .NET/CLI
multithreading, for hand tuning. Consider the code:
#include <vector>
int main()
{
using std::vector;
vector<int>someVec(100);
#pragma omp for
for(vector<int>::size_type i=0; i<someVec.size(); ++i)
someVec[i]=10*i;
}
C:\c>cl /clr temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.41013
for Microsoft (R) .NET Framework version 2.00.41013.0
Copyright (C) Microsoft Corporation. All rights reserved.
temp.cpp
Microsoft (R) Incremental Linker Version 8.00.41013
Copyright (C) Microsoft Corporation. All rights reserved.
/out:temp.exe
temp.obj
C:\c>
With this #pragma directive of the OpenMP 2 standard, the programmer
provides the guarantee that each assignment is independent of the other
assignments, and thus the compiler creates separate threads for each
assignment, taking advantage of the possible presence of multiple
processors in a system.
Consider this under the view of the upcoming multicore processors in the
mainstream, due to tend of 2005 - beginning of 2006.
Of course, according to the ISO C++ standard unknown #pragmas are
ignored, and thus the above code has no problem of portability to
compiles that do not support OpenMP:
C:\MinGW\bin\g++.exe -std=c++98 -pedantic-errors -Wall
-fexpensive-optimizations -O3 -ffloat-store -mcpu=pentiumpro temp.cpp -o
temp.exe
temp.cpp: In function `int main()':
temp.cpp:11: warning: ignoring #pragma omp for
Also VC++ 2005 will support Profile Guided Optimization.
The above will not be available to the other MS .NET languages.
According to MS, C++ becomes the systems programming language of .NET.
--
Ioannis Vranos
http://www23.brinkster.com/noicys