Rant after trying Rust a bit

simendsjo via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 22 13:50:51 PDT 2015


On Wednesday, 22 July 2015 at 19:52:34 UTC, Alex Parrill wrote:
> On Wednesday, 22 July 2015 at 18:47:33 UTC, simendsjo wrote:
>> Traits
>> ------
>> ...
>
> You can make a `conformsToSomeInterface!T` template, and use 
> `static assert`. D ranges, and the upcoming std.allocator, 
> already use this sort of 'interfaces without polymorphism'.
>
> Ex. `static assert(isInputRange!(MyCoolRange));`

Exactly. D is a lot more flexible, but looking just at
MyCoolRange, you cannot actually see it conforms to InputRange
without looking at the unittests (or wherever else the static
assert is inserted).

On Wednesday, 22 July 2015 at 19:52:34 UTC, Alex Parrill wrote:
> On Wednesday, 22 July 2015 at 18:47:33 UTC, simendsjo wrote:
>> Borrowing
>> ---------
>> ...
>
> Look into `std.typecons.Unique`, though I've seen people 
> posting that they don't like it (I haven't used it much; I had 
> one use case for it, which was sending it through 
> `std.concurrency.send`, but it doesn't work with that function).

I haven't actually tried to recreate the stuff that Rust does with
types in D. I expect some of it is possible, but the addition is
things like Unique (which I haven't tried). And this escalates.
You end up with `Unique!(NonNull!(MyClass))` and probably even
more type decorators.

On Wednesday, 22 July 2015 at 19:52:34 UTC, Alex Parrill wrote:
> Yes, D's community is pretty small. It's not something you can 
> just code; you have to market the language. And it's the 
> community that creates the many tools and packages.

If I'm not mistaken, people of the D community have tried to
market the language quite heavily. I don't know why more people
haven't joined, and it's even more baffeling to see the comments
on Reddit calling D related posts spam and speaking negatively of
the marketing on a site where upvotes dictates the ranking on the
front page.



More information about the Digitalmars-d mailing list