Comment
Comment by drweevil
Go goes at least part-way there.
https://golangbyexample.com/go-mod-tidy/
https://matthewsetter.com/go-mod-tidy-quick-intro/
You write your module source. You then run go mod tidy. This reads your sources for imports and automatically creates the go.mod and go.sum files
What's nice about this is that it ensures reproducible builds, so you should add those files to your revision control repo.