|
|
|
|
|
by WalterBright
144 days ago
|
|
D is an elegant re-imagine of C and C++. For a trivial example, typedef struct S { int a; } S;
becomes simply: struct S { int a; }
and unlike C: extern int foo();
int bar() { return foo(); }
int foo() { return 6; }
you have: int bar() { return foo(); }
int foo() { return 6; }
For more complex things: #include <foo.h>
becomes: import foo;
|
|
How are the build times? What does its package system(s) look like, and how populated are they? What are all its memory management options? How does it do error handling and what does that look like in real world code? Does it have any memory safety features, and what are their devtime/comptime/runtime costs? Does it let me participate in compile time optimizations or computations?
Don't get me wrong, we're on the same page about wanting to find a language that fills the C++ niche, even if it will never be as ideal as C++ in some areas (since C++ is significantly worse in other areas, so it's a fair trade off). But just like dating, I'm imagining the fights I'll have with the compiler 3 months into a full time project, not the benefits I'll get in the first 3 days.
* (a) I've been using structs without typedef without issue lately, which has its own benefits such as clarifying whether the type is simple or aggregate in param lists, while auto removes the noise in function bodies. (b) Not needing forward declarations is convenient, but afaik it can't not increase compile times at least somewhat. (c) I like the consistency here, but that's merely a principle; I don't see any practical benefit.