5 ms·
Isn't it a little odd that these are called modules when they sound very much like packages? In many languages, a module is just a source code file that can be
by dom96 8y ago
Isn't it a little odd that these are called modules when they sound very much like packages? In many languages, a module is just a source code file that can be imported. Why is Go redefining this term?
- adisbladis 8y agoGo already has a concept called 'package' (think Java package).
- masklinn 8y agoGo's terminology matches java, and is the exact reverse of your comments: a package is a namespace, a module is a bundle of 1..n namespaces (packages).
- paulddraper 8y agoJava "packages" are namespaces, Java "modules" are modules, and Maven/Ivy "modules" are packages.
- _old_dude_ 8y agoMaven modules are a bit of a mess, it's a set of packages but a package can be split into different Maven modules. I agree with the GP that go package/module are similar to Java package/module
- snuxoll 8y agoMaven modules aren’t necessarily packages; you can have POM only maven artifacts for things like BOM’s, for example. Thankfully the whole split-package nonsense will eventually go away, since the JPMS doesn’t allow a package to reside in multiple modules.
- paulddraper 8y agoJava packages (namespaces) can be split across Maven modules (packages). That doesn't seem weird to me. Lots of languages can split their namespaces across packages.
- ainar-g 8y agoYeah, that bothers me as well. Especially knowing that Go was in many ways inspired by Wirthian languages, in which a module is, well, a module.
- logicallee 8y agoI don't think there's a universal definition (as showed by the other replies to you, saying, actually it's the oppisite...) I think you just have to learn the meaning language by language. Here is someone asking about the nuance in Python: https://stackoverflow.com/questions/19198166/whats-the-difference-between-a-module-and-a-library-in-python https://stackoverflow.com/questions/19198166/whats-the-diffe... So Go can do what it wants as long as it is clear and you can find its definitions easily.
- rectang 8y agoWhat's crucial is that version numbers be tied to atomic units of distribution, regardless of what those units of distribution are called.
- kalekold 8y agoThe only reason is to be backwardly compatible with the Go community calling what they have at the minute packages. It is foreign to D developers too where packages are at the top level, then modules, etc.