-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Intro redux #16641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intro redux #16641
Conversation
ba2a15f
to
8e43219
Compare
return &i; | ||
} | ||
This introduction will give you a rough idea of what Rust is like, eliding many | ||
details. I does not require prior experience with systems programming, but you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In "I does not..." s/I/It
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!
General comment: Very easy to read, but I didn't get a sense of why ownership is a "better" model than garbage collection, or when it's "better". |
may find the syntax easier if you've used a 'curly brace' programming language | ||
before, like C or JavaScript. The concepts are more important than the syntax, | ||
so don't worry if you don't get every last detail: you can read [the | ||
Guide](guide.html) to get a more full explanation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'fuller', maybe? (That said, neither sounds horrible to me...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'More complete'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, +1 to complete
Fixed. |
It's been 9 days. r? |
0a39626
to
93f88d1
Compare
rebased |
|
||
```{bash} | ||
$ cargo update color | ||
Updating git repository `https://github.com/bjz/color-rs.git` | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step of cargo update color
isn't necessarily part of a normal workflow when adding a dependency. You're largely expected to just run cargo build
which will fetch it and update it as necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cargo build
automatically updates dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only if they don't previously have an entry in the lockfile (such as you just added a dependency)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh interesting. okay.
@alexcrichton @huonw I changed it to add the mutability thing and more about data races. See how you feel about this version |
associated resource until the count is zero. The 'atomic' portion refers to an | ||
Arc's usage of concurrency primitives to atomically update the count, making it | ||
safe across threads. If we use an Arc, we can have our ten references. But, an | ||
Arc can only hold immutable data, and we want to modify what we're sharing. In |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be more accurate to say: "But, an Arc does not allow mutable borrows of the data it holds"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call
nits addressed :) |
|
||
```{bash} | ||
$ cargo run | ||
Updating git repository `https://github.com/bjz/color-rs.git` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is still incorrect. along with the line under this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, thanks!
r=me with some squashing, thanks @steveklabnik! |
145c49d
to
5765b50
Compare
This was originally on my blog, so it's incredibly informal. Let's make it better.
5765b50
to
6c5bf9f
Compare
@liigo thanks, fixed. |
Because my '30 minute intro' was originally a blog post, the tone was a bit too light. It also was written a long time ago, and deserves a bit of a refresher for modern Rust. now that my work on the Guide is wrapping up, I want to give it a quick re-write as well. This is not yet done, but I'm submitting it for feedback so far. I'd really like some comments on the ownership part in particular, which gets lower level than before, but is not strictly 100% accurate. Trying to strike a balance. In general, I'm not sure I go into enough detail for those without systems experience, but am afraid of too much detail for those that do. Rendered view: https://github.com/steveklabnik/rust/blob/intro_redux/src/doc/intro.md /cc @wycats @nikomatsakis @brson etc
Because my '30 minute intro' was originally a blog post, the tone was a bit too light. It also was written a long time ago, and deserves a bit of a refresher for modern Rust. now that my work on the Guide is wrapping up, I want to give it a quick re-write as well.
This is not yet done, but I'm submitting it for feedback so far. I'd really like some comments on the ownership part in particular, which gets lower level than before, but is not strictly 100% accurate. Trying to strike a balance.
In general, I'm not sure I go into enough detail for those without systems experience, but am afraid of too much detail for those that do.
Rendered view: https://github.com/steveklabnik/rust/blob/intro_redux/src/doc/intro.md
/cc @wycats @nikomatsakis @brson etc