On Mon, Nov 11, 2013 at 3:21 PM, Gaetan <gae...@xeberon.net> wrote:
> 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.

Of course, "beauty" is subjective. Personally, I see it as
language-independent, and don't find it any harder to write beautiful
code in Rust than in any other language I know. It's certainly easier
than in some languages, since I don't have to spend as much time
debugging run-time errors and can spend that time making my code
aesthetically better.

>
> 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"

Once you gain experience with Rust, this will seem natural. You reason
about whether you're passing data by value or by reference (i.e.
borrowed pointer) anyway, and Rust just makes that distinction more
explicit.

> - 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++.

I'm not sure what your question is here, sorry.

Cheers,
Tim

>
> 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 <danielmi...@gmail.com> wrote:
>>>
>>>
>>>> On Sat, Nov 9, 2013 at 12:36 AM, Kevin Ballard <ke...@sb.org> wrote:
>>>> On Nov 8, 2013, at 2:21 PM, Patrick Walton <pcwal...@mozilla.com> 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
>> Rust-dev@mozilla.org
>> https://mail.mozilla.org/listinfo/rust-dev
>
>
>
> --
> -----
> Gaetan
>
>
>
> _______________________________________________
> Rust-dev mailing list
> Rust-dev@mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>



-- 
Tim Chevalier * http://catamorphism.org/ * Often in error, never in doubt
"If you are silent about your pain, they'll kill you and say you enjoyed it."
-- Zora Neale Hurston
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to