Announcement

Collapse
No announcement yet.

Rust 1.36 Brings Offline Support In Cargo, Stable Alloc Crate

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rust 1.36 Brings Offline Support In Cargo, Stable Alloc Crate

    Phoronix: Rust 1.36 Brings Offline Support In Cargo, Stable Alloc Crate

    The Rust language team is marking this US Independence Day by rolling out Rust 1.36...

    http://www.phoronix.com/scan.php?pag...-1.36-Released

  • #2
    They need an official way to sync all of crates.io and the documentation for that to be useful to new users, developers in working in a place that doesn't allow for tools that connect to the outside world, people who don't live in places with the best internet access, etc. I used to have to drive a 20 mile round trip to sync Debian repos to my laptop to update my desktop...yes, the entire Debian repo set including Debian-Multimedia and stable, testing, and unstable. When you live in the sticks without internet (2.5g on my phone with tethering...I miss my unlimited AT&T plan...fuckers ), Debian is just fine. I moved to Arch and friends when I was finally able to get broadband.

    I suppose it's useful if you're just compiling and working on bug fixes for existing projects, but if you're starting something new you might not know what you'll need until you need it.

    Comment


    • #3
      Originally posted by skeevy420 View Post
      They need an official way to sync all of crates.io and the documentation for that to be useful to new users, developers in working in a place that doesn't allow for tools that connect to the outside world, people who don't live in places with the best internet access, etc. I used to have to drive a 20 mile round trip to sync Debian repos to my laptop to update my desktop...yes, the entire Debian repo set including Debian-Multimedia and stable, testing, and unstable. When you live in the sticks without internet (2.5g on my phone with tethering...I miss my unlimited AT&T plan...fuckers ), Debian is just fine. I moved to Arch and friends when I was finally able to get broadband.

      I suppose it's useful if you're just compiling and working on bug fixes for existing projects, but if you're starting something new you might not know what you'll need until you need it.
      I don't know how big the entire repository is (and it's not just about the size, it matters a lot when you're serving it and have to provide that much bandwidth), and if there are install scripts that permit to make network requests when installing packages, it could render the offline mode unusable for all packages. I hope cargo isn't as bad as npm, and I assume it takes a lot to make something that awful.

      Comment


      • #4
        The crates.io repo is already downloaded fully (actually a git pull) whenever cargo might need to download something.
        You can already generate the docs for your code and deps using `cargo doc`, and get the std docs using rustup.
        Downloading "all" the actual crates is a non-starter however, as it would be too big (27K crates with multiple versions each). Instead, you put what you need in your Cargo.toml and run `cargo fetch` to download what you need. The download cache is global to your user, shared across projects on your system.

        The real appeal of `--offline` isn't that it'll error out early if the network is unreachable (that already worked), it's that cargo becomes more lenient in its dependency resolution. For example if `clap 2.33.0` is the latest according to the cached crates.io index but `clap 2.31.2` is the only one already downloaded, `cargo --offline` will use 2.31.2 instead of complaining that it can't fetch 2.33.0.

        Comment


        • #5
          Originally posted by skeevy420 View Post
          When you live in the sticks without internet (2.5g on my phone with tethering...I miss my unlimited AT&T plan...fuckers ), Debian is just fine. I moved to Arch and friends when I was finally able to get broadband.
          This is pretty rare today. Even satellite Internet services are offering unlimited data plans, or reduced speeds (1-3Mbps) after exceeding a bandwidth cap. Crate sources are rarely more than a handful of kilobytes, so Cargo's network usage isn't what you should be concerned about. You can even reduce network usage by using `rustup doc` instead of visiting the Rust website for documentation, or running `cargo doc` and opening the generated crate documentation instead of visiting `docs.rs`.

          That said, open source software development is always fairly heavy on the network usage once you start interacting with large projects with a lot of history in their versioning control, or depending on a lot of compiled shared dependencies. Things are much worse for C development.

          Comment


          • #6
            The biggest features in this release are really the stabilization of futures, significantly-improved hashmap performance, and the MaybeUninit<T> type to replace mem::uninitialized.

            There's a lot of low level code that relies on MaybeUninit behavior, and where mem::uninitialized is essentially UB with LLVM no matter how you use. The new type will make it possible to write more low level, optimized code, safely.

            The hashbrown crate is now the de facto implementation of hashmap in Rust, because it was significantly faster. It's based on Google's "Swiss Table" hash map algorithm.

            Futures being stable means that all the future-based libraries will migrate to official future implementation, which async and await depend upon. The previous way of managing futures was incredibly difficult, so this will bring out major ergonomics improvements to writing and managing async code. Once we get the async and await features in stable, Rust will be a perfect fit for a large number of areas that benefit from async I/O, and async computations.

            Comment


            • #7
              With all new C++ generations, what is the impact of Rust ?
              It's another language to learn, with what significant benefit that would outweight the cost ?

              Comment


              • #8
                Rust could use bittorrent like features of git-annex for those who want all crates.

                Rust is the fastest, lightest, securest language.

                Comment


                • #9
                  Originally posted by Brane215 View Post
                  With all new C++ generations, what is the impact of Rust ?
                  It's another language to learn, with what significant benefit that would outweight the cost ?
                  The impact of Rust is the same for C++03 as it is for C++20. New revisions aren't making it any closer to Rust's capabilities, or what it has achieved by starting from scratch with a new syntax. In order for C++ to be competitive with Rust, they'd need to rewrite the language from scratch, but then what they'd have is a completely different language, and no longer C++. The best you can do is imitate features with half-solutions, rather than having the complete solution.

                  Comment


                  • #10
                    Originally posted by DoMiNeLa10 View Post

                    I don't know how big the entire repository is (and it's not just about the size, it matters a lot when you're serving it and have to provide that much bandwidth), and if there are install scripts that permit to make network requests when installing packages, it could render the offline mode unusable for all packages. I hope cargo isn't as bad as npm, and I assume it takes a lot to make something that awful.
                    the problem with Cargo are the hundreds of micro packages, as well as this annoying automatic loading. so far you had libc, zlib, libjpeg and such – Rust/Cargo replaces this with hundreds, yes YES, multiple hundreds of small micro dependencies, like 4 header files like working with "bits", or terminal glue, and all sorts of fun stuff like this, ... https://www.youtube.com/watch?v=3MdTu8dSorY

                    Comment

                    Working...
                    X