Coder Social home page Coder Social logo

rust-tuts's People

Contributors

adrientetar avatar brentp avatar emberian avatar pitkley avatar seldaek avatar sophiebits avatar steveklabnik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rust-tuts's Issues

Extract and run code snippets in an automated fashion

This will make keeping the tutorial up-to-date easier, and will catch any accidental mistakes in the snippets.

(src/etc/extract-tests.py in the main Rust codebase is a script that does something similar for the examples in the "official" tutorial.)

Description of `as T`/conversions in general is incorrect

Here are the general rules:
cast as T ref change-no allocation ⇒ read-only &'a T -> &'a U
conversion .to_T() .into_T() allocates new memory “in-place” conversion, without copying &T -> ~U ~T -> ~U

You can see as as a sole modified reference to a value in memory, while others change the in-memory representation of the converted variable.

  • these aren't rules at all, just conventions that the stdlib attempts to follow (but can't always, e.g. (&str).into_owned() -> ~str has to allocate an new memory and copy, because it comes from a trait)
  • as T isn't a general conversion mechanism, in particular (&T) as (&U) is never ever valid, and T as U is only valid for a restricted subset of types. It should be .as_T() to match the the others
  • as T itself does change the in memory representation (e.g. int as f64 will perform a (relatively expensive) int -> f64 conversion: they're not bitwise identical)

Rust's name

The current document states:

Rust is also the result of a true willingness to reuse what’s been left by the rich history of programming languages, rather been building up the wheel over again. ;) ~ as you might have seen, that’s where the name “Rust” comes from!

However, this is not the whole story :)

Here is a quote from an email I got from Graydon when I asked him a few months back where the name came from, I think it should be put somewhere in the docs, but I'm not sure where so I open an issue for now:

I was fiddling with a number of names. Primarily it's named after the pathogenic fungi [1] which are just amazing multi-lifecycle, multi-host parasites, fascinating creatures.

But the name "rust" has other nice features. It fits with our theme of being "close to the metal" and "using old well-worn language technology". It's also a substring of "trust" and "robust". What's not to like?

[1] https://en.wikipedia.org/wiki/Rust_%28fungus%29

std::gc::Gc isn't a GC'd pointer

Optional tracing-GC (WIP) – the std::gc::Gc type recently landed on mainline

The Gc type is not a GC and definitely not tracing: it's currently just using @ internally.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.