Skip to content
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

Merged
merged 1 commit into from Oct 7, 2014
Merged

Intro redux #16641

merged 1 commit into from Oct 7, 2014

Conversation

steveklabnik
Copy link
Member

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

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

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@paulswartz
Copy link

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

@steveklabnik
Copy link
Member Author

@brson this isn't ready yet, it's just the first section! Good thing @bors failed :)

(I'm hoping to finish this today, though)

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.
Copy link
Member

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'More complete'?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, +1 to complete

@steveklabnik
Copy link
Member Author

Fixed.

@steveklabnik
Copy link
Member Author

It's been 9 days. r?

@steveklabnik
Copy link
Member Author

rebased


```{bash}
$ cargo update color
Updating git repository `https://github.com/bjz/color-rs.git`
```
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh interesting. okay.

@steveklabnik
Copy link
Member Author

@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
Copy link
Member

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"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call

@steveklabnik
Copy link
Member Author

nits addressed :)


```{bash}
$ cargo run
Updating git repository `https://github.com/bjz/color-rs.git`
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, thanks!

@alexcrichton
Copy link
Member

r=me with some squashing, thanks @steveklabnik!

This was originally on my blog, so it's incredibly informal. Let's make
it better.
@steveklabnik
Copy link
Member Author

@liigo thanks, fixed.

bors added a commit that referenced this pull request Oct 7, 2014
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
@bors bors closed this Oct 7, 2014
@bors bors merged commit 6c5bf9f into rust-lang:master Oct 7, 2014
@steveklabnik steveklabnik deleted the intro_redux branch October 25, 2017 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet