i ran through the rust “getting started” page (rust-lang.org/learn/get-starte). it's a hello-world project that has the rust crab mascot say hello, and consists of 10 lines of code actually written.

it results in pulling in 25 separate dependencies totalling up to 97 megabytes.

for reference the entire cowsay source is 168 lines/4 kilobytes of perl.


@nytpu They could have created that library without importing any dependencies. But the website is just demonstrating how to import a crate and use it.

@mmstick Well yeah, but it was amusing to have someone on irc bill it as the best new systems programming language and then the first experience I ever had with it was pulling in 25 dependencies for a hello world. And I'm not criticizing it for using a dependency, I'm criticizing it for using that many for such a simple library, and then them deciding that that was the perfect library to use when introducing people to the language. In my mind when I saw that, I figured it was emblematic of the community as a whole that using that many dependencies for a few lines of code was not considered strange or unusual (and yes, this does turn out to be true in most of the real rust code I've seen)

ferris-says is even more amazing because it's less flexible than cowsay, it can only print out just the rust crab saying something, so it's not even loading other characters like cowsay can. I understand the command line flag parser when it's used as a standalone program, but it should not be pulling that in (and compiling it!) when I'm using its library functionality. The only thing it should reasonably be using is the unicode library, which in itself shouldn't need any other dependencies, libicu for C and C++ certainly doesn't (unicode-org.github.io/icu/user)

@nytpu My experience, as a person that's been writing Rust since 2015, is that most Rust crates aren't importing other crates for no reason at all.

The reason ferris-says imports so many dependencies is that it's importing the clap crate. The clap crate is only used by command line applications wanting to have a professional command line argument parser. My guess is that the library also contains a binary target which is using clap, but you get to fetch clap too since it's not separated.

@nytpu And it's a little late to say someone on IRC is billing it as the best systems programming language. That's already been decided by Intel, the Linux kernel, GNOME, Red Hat, Microsoft, Apple, Google, and virtually everyone else.

Sign in to participate in the conversation

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.