As I started to address in a previous post [1], I’m confused by the concepts around Julia project structure and module re-use.
Background
For the sake of this discussion, I’ve created two repositories attempting to accomplish the same simple distance calculation: one in Python and one in Julia.
I cannot get the Julia one to run, for reasons partially discussed in this StackOverflow question, which has been graciously answered by @bkamins. Specifically, I cannot give an imported function a typed signature, due to type import problems detailed in the StackOverflow question. @bkamins suggests making structs.jl
[2] a local package, which confuses/surprises me.
Confusion: Python vs. Julia
I think I’m confused by the different concepts being used in Python and Julia imports. In Python, each file is a namespace and all functions + variables in the file are exported. In Julia, there can be multiple modules per file and functions must be explicitly exported.
Is it correct to say that modules in Julia are synonymous with namespaces in Python?
Going further, in Python, a package is a set of files shipped together and is often synonymous with a “project”. In Julia, is it common for a project to have multiple local packages? If yes, what is the reason for this design choice? I ask, not as a criticism, but so I can better understand/remember Julia project structure.
[1] I started a new thread, because the original thread was on a different topic.
[2] See linked Julia repository for structs.jl
source and purpose