Our great sponsors
Cargo | crates.io | |
---|---|---|
247 | 641 | |
10,978 | 2,554 | |
2.4% | 1.6% | |
9.8 | 9.9 | |
about 19 hours ago | 5 days ago | |
Rust | Rust | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Cargo
-
Learning Rust by Building a CLI App
To create a new application we'll use cargo (a build tool and also a package manager for Rust. It is used for scaffolding new library/binary projects). So in your projects folder, you can run this command in your terminal:
-
Leaving Haskell Behind
> ...but at the end of the day Cargo is the reason that Rust is popular.
FWIW, maybe that's true for you, but there are numerous other advantages to the language for which many people choose to use Rust--some even "despite" Cargo: you see Google having had to put in way way WAY too much work to get Bazel working for Rust :/--that it honestly feels a bit like belittling an extremely important language to make this claim so flippantly.
> You can set a default build target for a Cargo project with two lines of configuration, no nightly features necessary...
This doesn't work as, as soon as you start setting target-specific options, it infects the host build, as they incorrectly modelled the problem as some kind of map from targets to flags. If you don't believe me, on your Linux computer, try cross-compile something complicated that will runs on a "least common denominator" Linux distribution, such as CentOS 7.
> Can you clarify what this is referring to?
Sure. I've Googled rust cargo target host bugs for you (which, FWIW, finds a number of bugs I've filed or have talked about, but it isn't as if I have a list anywhere). Note that one of these bugs is "closed", but I still provide them for context as a patch might have been merged but (as you'll find out if you read through all of these) it isn't stable.
https://github.com/rust-lang/cargo/issues/8147
https://github.com/rust-lang/cargo/issues/3349
https://github.com/rust-lang/cargo/pull/9322
https://github.com/rust-lang/cargo/issues/9453
https://github.com/rust-lang/cargo/pull/9753
The result of this work being left incomplete is that increasingly large numbers of "serious" projects--things I'd expect people in packaging land to have heard of, such as BuildRoot--are being forced to set the ridiculous environment variable __CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly" in order to get access to a flag that makes Cargo sort of work.
(And yet, I often see people surprised at how long it is taking for various of the more important clients to fully get into using Rust, as the safety issues are so severe from continuing to use C/C++: as you made the contention that you believe the reason why people use Rust is Cargo, I will say the opposite: the reason why we don't see more Rust is also Cargo.)
-
Rust vs. Go in 2023
What has worked for me so far:
https://doc.rust-lang.org/book/
(do the exercises!)
plus a little bit of:
https://doc.rust-lang.org/cargo/
and
https://doc.rust-lang.org/std/index.html
(There's no need to remember the last URL -- just google "rust xxx" and you will get the right page.)
I'm looking forward to reading this:
https://nnethercote.github.io/perf-book/introduction.html
Sprinkle some blog posts on top:
https://xxchan.me/cs/2023/02/17/optimize-rust-comptime-en.ht...
https://matklad.github.io/2021/05/31/how-to-test.html
https://matklad.github.io/2021/08/22/large-rust-workspaces.h...
https://fasterthanli.me/articles/a-half-hour-to-learn-rust
https://fasterthanli.me/articles/working-with-strings-in-rus...
... and the rest is just a matter of applying enough sweat :)
-
PackagingCon – a conference only for software package management
I actually agree, yet it still has shortcomings. For eg https://github.com/rust-lang/cargo/issues/545 is still open (it's from 2014!!)
-
The Lazy Terminal Calculator
Rust uses a system to manage its libraries called Cargo. You can read more here. We can edit the Cargo.toml file and add the library under [dependencies].
-
Rust 1.71.0
From cargo's changelog [0]
> Automatically inherit workspace fields when running `cargo new`/`cargo init`. #12069 [1]
imo I think this is a big quality of life improvement
[0] https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#...
-
Testing the memory safe Rust implementation of Sudo/Su
You're probably running into this: https://github.com/rust-lang/cargo/issues/7058
`cargo vendor` will download dependencies for all platforms, which leads to a lot of unused code being pulled in. In this case, the Windows API and Microsoft compiler wrappers.
In this instance, during the build process "tempfile" is used as a dev-dependency, which has a runtime dependency on windows-sys when compiling Windows binaries. I'm not entirely sure why (commenting it out in Cargo.toml doesn't seem to break the build).
After commenting it out and manually removing the spurious Windows API files as well as the unrelated packages (ctor diff output_vt100 pretty_assertions proc-macro2 quote syn unicode-ident yansi), I get the following results:
0.0358 secs
-
Is there something "different" about Cargo's resolver in GitHub Actions?
btw we are looking at making the resolver to automatically select compatible MSRV dependencies. See https://github.com/rust-lang/cargo/issues/9930
Looking around I found also https://github.com/rust-lang/cargo/issues/10599, so I think I'm remembering correctly. Note that that mentions public/private dependencies. Most likely, we'd be dropping the resolver parts of the feature (for now). See https://github.com/rust-lang/rust/issues/44663.
-
Rust Module System Encourages Bad Practices
cargo fetch gets most of the way there. But you would need to build them as well to actually get good performance.
This is the upstream issue in question: https://github.com/rust-lang/cargo/issues/2644
Cargo fetch and/or cargo-chef kind of does these things, but not in a super intuitive and easy to use way.
crates.io
-
Appwrite + Rust: Build APIs without technical overhead
serde_json = "1.0" is a crate that uses the serde crate to manipulate JSON and vice versa.
-
Does anyone have a cloned copy of lib.rs, or know of a forked repo/archive/crate name?
Looking for crate on crates.io
-
Is it Ok to push a crate that is part of a github repository?
That is just fine, just keep in mind that crates.io will only see files within the actual crate you are publishing, for example it will not read the repo-level README.md. Here is one of my crates that is in a sub-directory: GitHub crates.io
-
Released my first crate ~20 hours ago; already downloaded 12 times. Who would know about it?
I released my first crate on crates.io yesterday and haven't advertised it or even started using the crates.io version in my code yet, but the crate has been downloaded 12 times. Is there some sort of audit process or automated caching that goes on with crates that would cause this to happen?
-
What is the "a" crate?
crates.io having no plan for namesquatters (and repeatedly refusing to use one) is the worst decision imaginable
Hard to say what the intentions were, but in this case probably just trying out how Cargo and crates.io work, and having not enough manners to clean up after themselves.
So are people prompted to give an irrevocable licence to crates.io somewhere?
This could all be fixed by just having accounts and namespaces. The problem is a crate appearing high on results for a search term on crates.io, if there are similar crates they should be able to use the same name and not be discriminated against on the basis of how close their name is to what people will search for
What is the "a" crate on crates.io? It seems to have many downloads, so what does it do? It has no dependencies or dependants - which seems to indicate people are either just downloading out of curiosity or not using it in published crates. Is this an example of name squatting? What does this crate do?
-
I am not happy with the `crates.io` search.
Imo crates.io is basically just the rusty pypi.org which isn't a great thing in my experience.
What are some alternatives?
RustCMake - An example project showing usage of CMake with Rust
Clippy - A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
RustScan - 🤖 The Modern Port Scanner 🤖
docs.rs - crates.io documentation generator
plotters - A rust drawing library for high quality data plotting for both WASM and native, statically and realtimely 🦀 📈🚀
opencv-rust - Rust bindings for OpenCV 3 & 4
cargo-outdated - A cargo subcommand for displaying when Rust dependencies are out of date
cargo-check
overflower - A Rust compiler plugin and support library to annotate overflow behavior
trunk - Build, bundle & ship your Rust WASM application to the web.
gtk4-rs - Rust bindings of GTK 4
rust-analyzer - A Rust compiler front-end for IDEs [Moved to: https://github.com/rust-lang/rust-analyzer]