Are there any default dmd optimizations

foobar foo at bar.com
Tue Feb 26 13:23:49 PST 2013


On Tuesday, 26 February 2013 at 18:41:24 UTC, Andrej Mitrovic 
wrote:
> On 2/26/13, foobar <foo at bar.com> wrote:
>> Rust on the other hand already
>> integrated an ownership system and is already far ahead of D's
>> design.
>
> Far ahead? It allows things like local variables shadowing 
> earlier declarations:
>
> let monster_size = monster_factor * 10.0;
> ...
> let monster_size: int = 50;
>
> That's straight from the tutorial. When has anyone thought to
> themselves "I need a new variable to store some result to, but 
> damn, I
> wish I could use an existing name but use it to store a 
> completely
> different type". That is an incentive to write unreadable code.
>
> And then there are things like this:
>
> "Note that, if applied to an integer value, ! flips all the 
> bits (like ~ in C)."
>
> So (!2 == true)?
>
> There are plenty of complaints for both languages (it's only 
> natural),
> but saying that Rust is somehow far ahead, I don't buy that one 
> bit.
> It's all too easy to cherrypick features which are in one 
> language and
> not in the other.

I don't get what fault you find in the binary NOT operation.
Regardless, my post wasn't really about specific features, 
(Walter actually mentioned those) but rather about the general 
design philosophy of D which I find lacking. Yes, it is obviously 
true that Rust has it own share of faults, The difference is what 
*principals* they use to address those faults and evolve the 
language.
Rust is written in Rust, thus the developers themselves feel all 
the shortcomings, they also listen to their users and they strive 
to find the best way to express the semantics they want in the 
possibly simplest yet readable syntax possible. They think 
positive and build on their vision, whereas D thinks negatively 
based on C++'s vision.
D exists for more than a decade and all it provides is slightly 
less hackish C++.
At first, I dismissed Rust for having poor syntax ("ret" really? 
Are we back to assembly?) but lo and behold, in a very short time 
they considerably improved the syntax. D still argues about the 
exact same issues from several years ago, as if it's stuck in a 
time loop. This to me shows a lack of direction. I expected thing 
to improve lately with all those newly minted release process 
discussions and such, but alas the attitude hasn't shifted at all.


More information about the Digitalmars-d mailing list