Hacker News new | ask | show | jobs
by g_airborne 2192 days ago
You could say that Rusts great dependency management is both a blessing and a problem at the same time. C programmers, often motivated by resource constraints, are much less likely to use third party dependencies - not just to save resources but also because it is just much harder to do it and to do it well. They end up just rewriting the parts they need themselves. Because those parts are likely a small subset of a full-featured library, binary size and compile times are smaller at the expense of actual time spent writing code.
3 comments

Also add the time maintaining that code.
Do we also need to add the time tracking down issues and dealing with all the licensing and churn issues in mostly unstable third party rust dependencies?
I'm about to ship my first Rust project for a client that actually cares about licensing stuff. It's trivial to add a new line to Cargo.toml, but can you legally redistribute it? What MIT-style copyright lines do I need to ship in our License file? Well, let's list the project dependencies and find out how many packages I need to go examine:

    $ ~/.cargo/bin/cargo-tree tree --no-indent | cut -f1 -d' ' | sort | uniq | wc -l
    61
Oi. I'm not sure this language dependency management thing is such a good idea.
That looks fantastic, thank you.
I'm working on a crate that'll build a String satisfying all the license requirements of a Cargo project's dependencies – you should be able to put that in a build script, include_str!() the file that the build script spits out, then display that string in the About box (like the convention of Windows Forms programs).

Of course, if anybody knows of an existing crate that does that, it'd save me the effort.

For a more polyglot license grep thing, I built https://github.com/akx/license-grep once upon a time. :)
> much harder to do it

What is harder? It is a single command to install most dependencies.

Using a C dependency is super easy from most languages, including C itself, of course.

> binary size and compile times are smaller at the expense of actual time spent writing code.

Nobody writing C professionally is doing that for those reasons unless the library is trivial.

You can remove unused symbols at linktime.