Let's be real about dependencies
wiki.alopex.li
wiki.alopex.li
There are regular posts in r/golang from new Go devs asking what frameworks to use, where to find the list of packages needed to do anything, etc. The answers are always "just use the standard library".
This is often portrayed as a result of Go's historically relatively poor package management. But I'd argue it's the other way around. Go's culture of avoiding dependencies meant that package management wasn't as big a requirement as it is in other languages.
It'll be interesting to see if the average number of dependencies in a Go project increases now that the package management system is more standardised and powerful.
Note that it's the transitive dependencies add up. Each project, even Rust, or even npm, has only a few direct dependencies on average.
Actual stats for Rust crates:
0 deps: 23.77% crates
1 dep: 13.81% crates
2 deps: 11.70% crates
3 deps: 10.33% crates
4 deps: 8.12% crates
5 deps: 5.75% crates
6 deps: 4.48% crates
7 deps: 3.84% crates
8 deps: 3.85% crates
9 deps: 2.61% crates
10 deps: 1.90% cratesIt'd be interesting to run the same analysis on Go projects and compare.
Maybe I've seen too many nightmare JS projects where this is literally true ;)
Rust uses these features for smaller things like faster hashmaps, custom strings (e.g. on stack, interned), iterator adapters, or custom channels. `defer` is provided via a library in Rust.