Rust updates

bearophile bearophileHUGS at lycos.com
Tue Dec 18 04:35:17 PST 2012


Marcel:

>> Rust designers seems to love really short keywords, this is in 
>> my opinion a bit silly. On the other hand in D you have 
>> keywords like "immutable" that are rather long to type. So I 
>> prefer a mid way between those two.
>
> They aren't silly, they're consistent. We have int, char, auto,
> they have fn, var, and val which are common these days, why not
> mut, pub, and priv?

They are a bad design choice. Using very shortened 
identifiers/names is acceptable only when they are very common 
(time ago I even suggested in D to use "str" as in Python, 
instead of "string"). "mut", "pub", and "priv" optimize the wrong 
thing.

There are of cases where D goes too much far (like 
"std.random.randomShuffle" or "schwartSort" in Phobos, or 
"immutable" among the keywords) but in general the naming choice 
of D is better than Rust.


>> Rust supports several types of pointers. The simplest is the 
>> unsafe pointer, written *T, which is a completely unchecked 
>> pointer type only used in unsafe code (and thus, in typical 
>> Rust code, very rarely).

(This wasn't a quotation from me)

Bye
bearophile


More information about the Digitalmars-d mailing list