So in Package Naming Rules it’s clear that package names should contain .jl suffix.
Package names already have a .jl extension, which communicates to users that Package.jl is a Julia package.
Yet, the example of using generate from that documentation does the following:
> generate HelloWorld
which creates a folder called “HelloWorld” and not “HelloWorld.jl”. Futher, the Project.toml created contains
name = "HelloWorld"
uuid = "b4cd1eb8-1e24-11e8-3319-93036a3eb9f3"
version = "0.1.0"
authors = ["Some One <someone@email.com>"]
[deps]
where the name tag also doesn’t contain the .jl suffix. To me this is rather confusing and I don’t really see the rationale behind it. Probably I’m missing something obvious here.
2 Likes
My personal view on this is: That is the difference between intrinsic and extrinsic views.
For example:
- I also always rename the folder to
MyPackage.jl, since I consider this something that also outside of Julia someone might see in their folder tree
- Within the
Project.tomls name, all package names would have that suffix, so one can skip that, since it is clear from context
- similarly you would only write
] add MyPackage without .jl since in Pkg mode it is clear we talk about packages
On on a concrete example: I develop Manopt.jl , but the name originates from Manopt (Matlab), so there the suffix is important to indicate that the Julia package is different from the Matlab version (which has no suffix) - similar to the python package of the same style is called pymanopt.
So as soon as it is clear from context (and for the Folder I disagree with the default generation even
) – one can drop the .jl in the name, but in more generic contexts it is nice to have the suffix. Also for example here in the forum where package names are linked automatically (recognised by the suffix).
1 Like
In my opinion it’s opinionated nonsense to claim that .jl is part of the package name. The name is what’s in Project.toml. Having the .jl suffix in repository names has been a very useful convention for getting better web search results, though.
4 Likes
Thanks for the answers! Very helpful @kellertuer @GunnarFarneback 
If I understand your point of view correctly, which I agree with, it would be better to say in the documentation that you should NOT put .jl in your package name but the repository name should have it?
Interestingly if I call generate Hello.jl the name tag in the Project.toml file still becomes just Hello which to me says that the “Package Name” should never contain .jl but repo should and folder can?