News for hackers. Stuff that matters.
Re:The semver trick (2019) by kibwen on Saturday August 01, 2020 @02:32PM (#24022780)
I only encounter this in Rust when doing anything web-related. There's quite a lot of prominent authors who go out of their way to reduce their dependencies by any means necessary (e.g. https://github.com/tokio-rs/tokio/pull/1324 , which is a notably extreme case).
Re:The semver trick (2019) by dmitriid on Saturday August 01, 2020 @05:54PM (#24024211)
> I only encounter this in Rust when doing anything web-related.

It's probably because anything web-related requires so many things no readily available in the language or in the standard library: anything from databases (sometimes different breeds of databases) to templating to serialisation (possibly multiple types of serialisation) to rest or graphql to...

Just serialisation (which is almost invariable Serde) will pull in at least 54 dependencies (if you only use serde and serde_json). A framework such as rocket which provides all that, and more, will pull in ... 332 dependencies :)

Edit: Calculation is invalid, see https://news.ycombinator.com/item?id=24024671

Re:The semver trick (2019) by dtolnay on Saturday August 01, 2020 @06:53PM (#24024626)
> Just serialisation (which is almost invariable Serde) will pull in at least 54 dependencies (if you only use serde and serde_json).

What is this number referring to? Serde + serde_json with all their transitive dependencies is maximum 12 crates (for someone who has enabled all optional features), though in typical usage it's 9 crates: serde, serde_derive, serde_json, syn, quote, proc-macro2, unicode-xid, itoa, ryu. I haven't figured out how you got to 54.

Re:The semver trick (2019) by dmitriid on Saturday August 01, 2020 @07:02PM (#24024671)
I ran `cargo tree -e all | wc -l`. Now I realise that's not a proper way to do it :-/

Looks like `cargo metadata --format-version=1 | jq -r ".packages|map(.name)|.[]"` is the way to do it.

- 10 for serde + serde_json

- 88 for rocket only