Just an humble opinion.

I kind of like saying that the code i write must be beautiful. The langage
should allow to write "beautiful" code. It is more than a personnal point
of view, it is also very important. if it is a pain in the ... to use an
essential feature, or if i will never remember how to do it without copy
paste because there is no "logic" behind it, i will have a bad opinion on
the langage itself.

The real question are:
- as a typicial rust programmer, will i see the usage of "str" or "~str" as
logic or will i have to copy paste some sample code each time "because it
works this way in rust"
- the boilder plates theory. Can i avoid them? I think a good modern
language should allow me to avoid writing useless code, each time the same
things. That is the real mess with C++.

Gaetan

Le samedi 9 novembre 2013, spir a écrit :

> On 11/09/2013 06:43 AM, Kevin Ballard wrote:> On Nov 8, 2013, at 9:38 PM,
> Daniel Micay <[email protected]> wrote:
>
>>
>>  On Sat, Nov 9, 2013 at 12:36 AM, Kevin Ballard <[email protected]> wrote:
>>> On Nov 8, 2013, at 2:21 PM, Patrick Walton <[email protected]> wrote:
>>>
>>>  I know that many people don't like the fact that, syntactically,
>>>> vectors and strings have a sigil in front of them, but please consider that
>>>> there are many design constraints here. What works for another language may
>>>> not work for Rust, because of these constraints.
>>>>
>>>
>>> Personally, I find it great that they have a sigil in front of them. It
>>> reminds me that they're stored in the heap.
>>>
>>> -Kevin
>>>
>>> Since library containers, smart pointers and other types don't have
>>> them, I don't think it's helpful in that regard.
>>>
>>
>> Well no, you can't assume that the absence of a sigil means the absence
>> of heap storage. But for types that are possibly not stored on the heap,
>> such as str (which can be &'static str) and [T] (which can be a fixed-size
>> stack-allocated vector), the ~ is a useful distinction.
>>
>> -Kevin
>>
>
> Can we, then, even consider the opposite: having a sigil for static data
> (mainly literal strings stored in static mem, I'd say) or generally
> non-heap data (thus including eg static arrays stored on stack)? The
> advantage is that this restores coherence between all heap of heap data.
> I'd use '$'! (what else can this sign be good for, anyway? ;-)
>
> [But where should the sigil go? In front of the data literal, as in
>         let stst = $"Hello, world!";
>         let nums = $[1,2,3];
> or in front of the type, or of the id itself?]
>
> Also, is it at all possible, in the long term maybe, to consider letting
> the compiler choose where to store, in cases where a possible pointer is
> meaningless, that is it does not express a true reference (shared object,
> that a.x is also b.y), instead is used for technical or efficiency reasons
> (that memory is not elastic!, for avoiding copy, etc...)?
>
> Denis
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
>


-- 
-----
Gaetan
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to