top | item 36235468

(no title)

svnpenn | 2 years ago

> it is pretty much identical to go.

Its not.

with Go you have ONE go.mod file, at the module root. you may have 100 sub packages or sub sub sub packages, but still only ONE go.mod file. then any time you need to add a new import at ANY level, you just go "go mod tidy", and DONE. please dont try to compares apple and orange and say they are both apples.

discuss

order

kjuulh|2 years ago

There really isn't a huge difference, both have workspaces, and both allows you to add arbitrary go.mod or Cargo files where you want. The biggest difference is that go defines a module as a folder, where rust does it pr file. That said I don't know how that plays into how it is compiled.

Any of these subpackages, if they don't have a go.mod file, would require defining their dependencies top level as well, and when you go get the package you would need to pull everything, even if you only need a subpackage. Which usually isn't a problem, because golang is super fast to compile.

I get that they aren't identical, but tbh they are pretty close

pjmlp|2 years ago

Additionally Go requires search and replace all over the place, if a module ever changes it SCM location, and having internal build caches for the company, not even bother.

jen20|2 years ago

This is far from the only way to work with Go, and is one of the worst, as it leads to uncontrolled dependency sprawl.