About RFC: "A 30 minute introduction to Rust"

classic Classic list List threaded Threaded
53 messages Options
123
Reply | Threaded
Open this post in threaded view
|

About RFC: "A 30 minute introduction to Rust"

Fernando Pelliccioni
This is a misleading propaganda against C++. I think it's pure marketing. 
I hope this code ugly C++ was not on purpose. 

I think it would be fair that you enable comments on the website so I can show how to code in real C++. Do you dare to discuss seriously? 

If the feedback is in a different place (mailing list), the reader of the article does not have a chance to really compare the two languages. 

Regards,
Fernando Pelliccioni,

_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Patrick Walton-2
On 3/2/14 8:34 PM, Fernando Pelliccioni wrote:
> This is a misleading propaganda against C++. I think it's pure marketing.
> I hope this code ugly C++ was not on purpose.
>
> I think it would be fair that you enable comments on the website so I
> can show how to code in real C++. Do you dare to discuss seriously?
>
> If the feedback is in a different place (mailing list), the reader of
> the article does not have a chance to really compare the two languages.

Sorry, but discussion of blog posts that aren't part of the official
Rust documentation aren't on-topic for this mailing list. Please email
Steve privately.

Patrick

_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Fernando Pelliccioni
What about "Feedback very welcome on the rust-dev mailing list or on Twitter." ?


On Mon, Mar 3, 2014 at 1:38 AM, Patrick Walton <[hidden email]> wrote:
On 3/2/14 8:34 PM, Fernando Pelliccioni wrote:
This is a misleading propaganda against C++. I think it's pure marketing.
I hope this code ugly C++ was not on purpose.

I think it would be fair that you enable comments on the website so I
can show how to code in real C++. Do you dare to discuss seriously?

If the feedback is in a different place (mailing list), the reader of
the article does not have a chance to really compare the two languages.

Sorry, but discussion of blog posts that aren't part of the official Rust documentation aren't on-topic for this mailing list. Please email Steve privately.

Patrick

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


_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Fernando Pelliccioni
I don't have the Steve's email address.
Please could someone provide it.
Thanks.


On Mon, Mar 3, 2014 at 1:41 AM, Fernando Pelliccioni <[hidden email]> wrote:
What about "Feedback very welcome on the rust-dev mailing list or on Twitter." ?


On Mon, Mar 3, 2014 at 1:38 AM, Patrick Walton <[hidden email]> wrote:
On 3/2/14 8:34 PM, Fernando Pelliccioni wrote:
This is a misleading propaganda against C++. I think it's pure marketing.
I hope this code ugly C++ was not on purpose.

I think it would be fair that you enable comments on the website so I
can show how to code in real C++. Do you dare to discuss seriously?

If the feedback is in a different place (mailing list), the reader of
the article does not have a chance to really compare the two languages.

Sorry, but discussion of blog posts that aren't part of the official Rust documentation aren't on-topic for this mailing list. Please email Steve privately.

Patrick

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



_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Corey Richardson
Notice that there was a link to a two-month old thread on the list.
His email is in that...

On Sun, Mar 2, 2014 at 11:44 PM, Fernando Pelliccioni
<[hidden email]> wrote:

> I don't have the Steve's email address.
> Please could someone provide it.
> Thanks.
>
>
> On Mon, Mar 3, 2014 at 1:41 AM, Fernando Pelliccioni
> <[hidden email]> wrote:
>>
>> What about "Feedback very welcome on the rust-dev mailing list or on
>> Twitter." ?
>>
>>
>> On Mon, Mar 3, 2014 at 1:38 AM, Patrick Walton <[hidden email]>
>> wrote:
>>>
>>> On 3/2/14 8:34 PM, Fernando Pelliccioni wrote:
>>>>
>>>> This is a misleading propaganda against C++. I think it's pure
>>>> marketing.
>>>> I hope this code ugly C++ was not on purpose.
>>>>
>>>> I think it would be fair that you enable comments on the website so I
>>>> can show how to code in real C++. Do you dare to discuss seriously?
>>>>
>>>> If the feedback is in a different place (mailing list), the reader of
>>>> the article does not have a chance to really compare the two languages.
>>>
>>>
>>> Sorry, but discussion of blog posts that aren't part of the official Rust
>>> documentation aren't on-topic for this mailing list. Please email Steve
>>> privately.
>>>
>>> Patrick
>>>
>>> _______________________________________________
>>> Rust-dev mailing list
>>> [hidden email]
>>> https://mail.mozilla.org/listinfo/rust-dev
>>
>>
>
>
> _______________________________________________
> Rust-dev mailing list
> [hidden email]
> https://mail.mozilla.org/listinfo/rust-dev
>



--
http://octayn.net/
_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Patrick Walton-2
In reply to this post by Fernando Pelliccioni
On 3/2/14 8:41 PM, Fernando Pelliccioni wrote:
> What about "Feedback very welcome on the rust-dev mailing list or on
> Twitter." ?

Oh, I didn't realize the blog post contained that. Well, I assume that
was soliciting feedback regarding using the post, or something derived
from it, as an official tutorial for Rust. In that case, I think
official documentation shouldn't be directly trying to "sell" Rust
against other languages, and I would prefer that any such verbiage be
removed from an official tutorial.

Patrick

_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Steve Klabnik
I originally wrote that because I also made a post to the rust-dev
mailing list, and I assumed that people may want to talk about it
there. Totally, brand-new threads weren't expected at this moment.
I'll take that out of the post.
_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Steve Klabnik
Oh, Patrick, I slightly mis-read what you said. Yes, that was the intention.

> I think official documentation shouldn't be directly trying to "sell" Rust against other languages,

While I agree, comparing against things we already know is a powerful
way to learn. I _do_ think that we shouldn't say "C++ is terrible,"
because it's not, but I do feel that not making some references to
other languages is basically impossible.
_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Fernando Pelliccioni

On Mon, Mar 3, 2014 at 8:06 PM, Steve Klabnik <[hidden email]> wrote:
Oh, Patrick, I slightly mis-read what you said. Yes, that was the intention.

> I think official documentation shouldn't be directly trying to "sell" Rust against other languages,

While I agree, comparing against things we already know is a powerful
way to learn. I _do_ think that we shouldn't say "C++ is terrible,"
because it's not, but I do feel that not making some references to
other languages is basically impossible.


Steve,

My point is that I could show how to program in C++. 
This "another" way of C++ is very similar to Rust, so, the distance between C++ and Rust would not be as large as that which you have stated in your article.

...So, the benefits of using Rust would not be as exaggerated if we include other factors into the equation, then the reader would be better informed. 
Could you be so kind as to enable comments on your page?

Thanks,
Fernando.


_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Daniel Micay
In reply to this post by Steve Klabnik
On 03/03/14 06:06 PM, Steve Klabnik wrote:
> Oh, Patrick, I slightly mis-read what you said. Yes, that was the intention.
>
>> I think official documentation shouldn't be directly trying to "sell" Rust against other languages,
>
> While I agree, comparing against things we already know is a powerful
> way to learn. I _do_ think that we shouldn't say "C++ is terrible,"
> because it's not, but I do feel that not making some references to
> other languages is basically impossible.

I think documentation comparing Rust to C++ is fine, but it should be
written from a neutral perspective. That means doing an apples to apples
comparison rather than showing the safe feature in Rust and the unsafe
feature in C++, when both variants exist in both languages.

Type-checked lifetimes on references and type-checked move semantics are
examples of true safety improvements over C++. They are not a panacea as
they prevent expressing many safe patterns, even when the safety is
obvious to a human or a more complex type-checking algorithm.

If you're not familiar with writing in a modern dialect of C++11 with
similar idioms to Rust, then I don't think writing articles comparing
the languages is fair. Rust doesn't bring anything new to the table when
it comes to destructors, allocators or smart pointers. It's still
playing catch-up to C++11 and Boost in these areas.


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

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Steve Klabnik
Part of the issue with that statement is that you may or may not
program in this way. Yes, people choose certain subsets of C++ that
are more or less safe, but the language can't help you with that.
_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Fernando Pelliccioni
Then, you could show this in the article, using the "good" subset of C++. Then people can choose.



On Mon, Mar 3, 2014 at 10:19 PM, Steve Klabnik <[hidden email]> wrote:
Part of the issue with that statement is that you may or may not
program in this way. Yes, people choose certain subsets of C++ that
are more or less safe, but the language can't help you with that.
_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev


_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Lindsey Kuper-3
> On Mon, Mar 3, 2014 at 10:19 PM, Steve Klabnik <[hidden email]>
> wrote:
>>
>> Part of the issue with that statement is that you may or may not
>> program in this way. Yes, people choose certain subsets of C++ that
>> are more or less safe, but the language can't help you with that.

On Mon, Mar 3, 2014 at 6:22 PM, Fernando Pelliccioni
<[hidden email]> wrote:
> Then, you could show this in the article, using the "good" subset of C++.
> Then people can choose.

I think Steve's point is that, with Rust, you get a language-level
guarantee.  With C++, you can avoid the unsafe parts, but to do so you
have to be especially vigilant; it's easy to accidentally get into
unsafe territory.  With Rust, you always know when you're stepping
into unsafe territory.  At least, that's the goal.

Lindsey
_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Patrick Walton-2
In reply to this post by Daniel Micay
On 3/3/14 4:32 PM, Daniel Micay wrote:
> Type-checked lifetimes on references and type-checked move semantics are
> examples of true safety improvements over C++. They are not a panacea as
> they prevent expressing many safe patterns, even when the safety is
> obvious to a human or a more complex type-checking algorithm.

Avoiding the unsafe patterns (such as unsafe pointers, e.g. `this`) is
very difficult in C++, however. Nothing is a panacea as far as zero-cost
safety is concerned. However, any provably memory-safe subset of C++11
would be even more limiting, as it would rule out any use of methods
(except perhaps with `enable_shared_from_this` and use of `shared_ptr`
for *all data*).

> If you're not familiar with writing in a modern dialect of C++11 with
> similar idioms to Rust, then I don't think writing articles comparing
> the languages is fair. Rust doesn't bring anything new to the table when
> it comes to destructors, allocators or smart pointers. It's still
> playing catch-up to C++11 and Boost in these areas.

It does enforce that you don't do any unsafe things when using
destructors, allocators, or smart pointers without using the *unsafe*
keyword, which is an improvement to me.

Patrick

_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Daniel Micay
In reply to this post by Lindsey Kuper-3
On 03/03/14 08:36 PM, Lindsey Kuper wrote:

>> On Mon, Mar 3, 2014 at 10:19 PM, Steve Klabnik <[hidden email]>
>> wrote:
>>>
>>> Part of the issue with that statement is that you may or may not
>>> program in this way. Yes, people choose certain subsets of C++ that
>>> are more or less safe, but the language can't help you with that.
>
> On Mon, Mar 3, 2014 at 6:22 PM, Fernando Pelliccioni
> <[hidden email]> wrote:
>> Then, you could show this in the article, using the "good" subset of C++.
>> Then people can choose.
>
> I think Steve's point is that, with Rust, you get a language-level
> guarantee.  With C++, you can avoid the unsafe parts, but to do so you
> have to be especially vigilant; it's easy to accidentally get into
> unsafe territory.  With Rust, you always know when you're stepping
> into unsafe territory.  At least, that's the goal.
It's no harder to avoid direct usage of `malloc` in C++ than it is in
Rust. Rust doesn't make this more explicit anyway, and `malloc`
technically shouldn't be considered unsafe at all because we do not
consider memory leaks unsafe. There are ways Rust improves on safety
like lifetimes and preventing use-after-move... but this isn't one.

As a C++ programmer, comparisons like this would stop me from looking
into Rust if I wasn't already familiar with it. It makes it seem like
the language is just a "me too" attempt at fixing problems that are not
broken in C++. No one stops you from writing your entire Rust program
with `unsafe` functions just as no on stops you from using `malloc`
everywhere in C++. Neither takes more vigilance to avoid.


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

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Daniel Micay
In reply to this post by Patrick Walton-2
On 03/03/14 08:41 PM, Patrick Walton wrote:

> On 3/3/14 4:32 PM, Daniel Micay wrote:
>> Type-checked lifetimes on references and type-checked move semantics are
>> examples of true safety improvements over C++. They are not a panacea as
>> they prevent expressing many safe patterns, even when the safety is
>> obvious to a human or a more complex type-checking algorithm.
>
> Avoiding the unsafe patterns (such as unsafe pointers, e.g. `this`) is
> very difficult in C++, however. Nothing is a panacea as far as zero-cost
> safety is concerned. However, any provably memory-safe subset of C++11
> would be even more limiting, as it would rule out any use of methods
> (except perhaps with `enable_shared_from_this` and use of `shared_ptr`
> for *all data*).
>
>> If you're not familiar with writing in a modern dialect of C++11 with
>> similar idioms to Rust, then I don't think writing articles comparing
>> the languages is fair. Rust doesn't bring anything new to the table when
>> it comes to destructors, allocators or smart pointers. It's still
>> playing catch-up to C++11 and Boost in these areas.
>
> It does enforce that you don't do any unsafe things when using
> destructors, allocators, or smart pointers without using the *unsafe*
> keyword, which is an improvement to me.
>
> Patrick
>
Smart pointers and destructors are no more unsafe in C++ than they are
in Rust. Rust makes moves and references safe, it doesn't do anything to
make a smart pointer implementation more safe.


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

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Patrick Walton-2
On 3/3/14 5:51 PM, Daniel Micay wrote:
> Smart pointers and destructors are no more unsafe in C++ than they are
> in Rust. Rust makes moves and references safe, it doesn't do anything to
> make a smart pointer implementation more safe.

It prevents you from misusing smart pointers and destructors to do
unsafe things, without the *unsafe* keyword. For example, calling the
Rust equivalents of `std::shared_ptr::get()` or
`std::shared_ptr::operator->()` in C++, storing the resulting raw
pointer in a compiler-untracked location, and dereferencing it later
requires the *unsafe* keyword in Rust.

Patrick

_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Daniel Micay
In reply to this post by Steve Klabnik
On 03/03/14 08:19 PM, Steve Klabnik wrote:
> Part of the issue with that statement is that you may or may not
> program in this way. Yes, people choose certain subsets of C++ that
> are more or less safe, but the language can't help you with that.

You can choose to write unsafe code in Rust too. The safe subset of Rust
is exactly that: a subset. A function leaking memory does not qualify as
unsafe in Rust anyway, so destructors and smart pointers aren't a very
compelling example of safety improvements. Checked move semantics and
lifetimes are where the safety comes from.


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

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Patrick Walton-2
On 3/3/14 5:53 PM, Daniel Micay wrote:
> On 03/03/14 08:19 PM, Steve Klabnik wrote:
>> Part of the issue with that statement is that you may or may not
>> program in this way. Yes, people choose certain subsets of C++ that
>> are more or less safe, but the language can't help you with that.
>
> You can choose to write unsafe code in Rust too.

You have to write the *unsafe* keyword to do so.

Patrick

_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
Reply | Threaded
Open this post in threaded view
|

Re: About RFC: "A 30 minute introduction to Rust"

Steve Klabnik
When I first wrote this, there was a LARGE amount of discussion on HN.
Here's one particular subthread that seems relevant:
https://news.ycombinator.com/item?id=7052518

It includes a C++11 bit of code with uniq_pointer that crashes.
_______________________________________________
Rust-dev mailing list
[hidden email]
https://mail.mozilla.org/listinfo/rust-dev
123