More on Rust language

bearophile bearophileHUGS at lycos.com
Thu Nov 3 21:14:54 PDT 2011


Walter Bright:

> You're wrong still :-)

In this newsgroup I am used to being wrong several times every day :-)


> It can be done if the D compiler emits full runtime type info. It's a solved 
> problem with GCs.

I see, I will have to read more on this solution.


> Besides, having two pointer types in D would be disastrously complex.

Rust has three pointer types! :-)
In Ada too I think there are three types of pointers.


> (I've dealt with multiple 
> pointer types from the DOS daze, and believe me it is a BAD BAD BAD idea.)

I am not sure, but I think the situation is very different here. Here it's only the type system that tells those pointers them apart, and restricts the kinds of operations you are allowed to do with them or changes the things they do.

In Rust it's not the kind of memory they point to that tells what they are (as I presume was in DOS), here you are allowed to use one of the three kinds of pointers, as you like, for each kind of data you want. The difference is all in their semantics. I think this is very different from the DOS pointers situation.

>From the examples of Rust code I've read, I have not seen any disaster regarding the design of its pointers. They have implemented a not small compiler with the language, so I think the pointer situation is not awful.

Regarding pointer types, in D there are function pointers and function delegates, they are kind of two different kinds of pointers already. They increase language complexity, its usage, and require some conversion code, but they are not a disaster to use.

Thank you for your answers,
bye,
bearophile


More information about the Digitalmars-d mailing list