Rant after trying Rust a bit

Enamex via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 30 20:41:33 PDT 2015


On Wednesday, 22 July 2015 at 18:47:33 UTC, simendsjo wrote:
> Long rant ahead - a bit dipsy..
>
> TL;DR: Rust has momentum, manpower and tooling. Tooling 
> matters.  Safe defaults.  Ergonomics like expressions and 
> deconstructing rocks.
> [...]
> But again... After playing a bit with Rust, I feel it lacks a 
> lot in expressive power. D has templates, template mixins, 
> alias this, string mixins, opDispatch etc. In my little time 
> with Rust, I've seen several pages of generic constrains that 
> is expressible in a couple of lines with D. I've seen 
> copy/pasted code that just isn't necessary when you code in D.
>
> Anyways - my little ramblings after trying the Rust programming 
> language while I haven't used D in a long, long while (But I'm 
> still here now, as I'm not sure Rust is able to express 
> everything that is possible with D). Looking forward to 
> following D again :)

Mostly my experience, so far. If I have to choose the 'most 
important' things that Rust has that I'd *definitely* want in D, 
I'd pick (in order):

* A really nicely integrated package manager like Cargo that goes 
seamlessly hand-in-hand with DMD.
* DDMD
* An attribute or something that makes it explicit to the 
compiler that this type is a 'one time use' deal, and /exactly/ 
one-time-use (or, to be practical, zero-or-one times). Copying 
instances of objects of that type is done by `.dup`. (Like a 
non-Copy type in Rust currently.)
* Sum Data Types (`enum`s in Rust and `data D = VarA | VarB` in 
Haskell). As well as:
   * Pattern matching. `Algebraic!` is okay but pattern-matching 
that goes with it isn't PM.

But maybe that's for D 3.0 in 2030 or maybe another language... 
(I just want SML with at least D's speed T_T. I already got 
something /very roughly/ akin to ML's functors from D's template 
and mixin magic...)


More information about the Digitalmars-d mailing list