C, Objective-C, C++... D! Future Or failure?
TDRighteo writes "OSNews is carrying a quick introduction to a programming language under development - D. Features include garbage collection, overrideable operators, full C compatibility, native compilation, inline assembler, and in-built support for unit testing and "Design by Contract". With all the discussion about the future of GNOME with Java/Mono, does D offer hope of a middle-road? Check out the comparison sheet."
You fucking geek.
From the page, here is some sample code of an "out" type parameter. (Think of it as a one way reference)
// bar is now 0
out parameters are set to the default initializer for the type of it. For example:
void foo(out int bar)
{
}
int bar = 3;
foo(bar);
The immediate problem I can see with this, is the same as using references in C++. There is no indication in the calling procedure that the variable passed in can be changed by the called procedure. In C, you can only do this by passing pointers, and as such you know that foo(&bar); can change the bar. (or that the variable you are passing in is a pointer, and thus can change what it's pointed too).
This sort of thing is only important after code has been written, and is now being maintained by other folk. The other folk not being familiar with foo, will have no idea that bar can be changed.
Inline assembler
That's an implementation-dependent feature, not a language feature of C/C++.
Direct access to hardware
C# has unsafe pointers (in unsafe modules), so it has this feature to the same degree that C and C++ do.
Explicit memory allocation control
C# very much has explicity memory allocation control. In fact, C# has similar low-level programming features to C/C++, but it packages them MUCH better.
Independent of VM, Direct native code gen
Both Java and C# have implementations that do "direct native code gen", in the sense that you can take source code and have a compiler generate shared libraries. Both languages can be implemented without a VM, although many libraries (and many application programmers!) want the functionality that the VM provides. Where is D's VM?
Templates
If he really means "templates", I'm glad that none of the other languages have them. Templates are a specific feature of C++--enormously useful, but very poorly designed. C# has parameterized types, which are less powerful but a better design.
Support all C types
I'm not sure what that is supposed to mean. C doesn't have a well-defined set of specific types, it has type names for implementation defined types satisfying minimum requirements. C# certainly has a complete set of types corresponding to that.
Struct member alignment control
Not only does C# have struct member alignment control, it has it in a way that is more explicit and better designed than what C and C++ have.
Java doesn't deal with physical memory mapping you idiot , its a higher level language so endian issues don't come into it. I should have qualified
my statement with "low level" compiled languages. BASIC can be compiled but you don't get endian issues there either.