Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exported symbols shouldn't be public by default #53973

Closed
nsajko opened this issue Apr 6, 2024 · 3 comments
Closed

exported symbols shouldn't be public by default #53973

nsajko opened this issue Apr 6, 2024 · 3 comments
Labels
design Design of APIs or of the language itself kind:speculative Whether the change will be implemented is speculative

Comments

@nsajko
Copy link
Contributor

nsajko commented Apr 6, 2024

#50105 retroactively made all exported symbols public. I think I raised this point before in some comment, but anyway exported symbols being public by default seems like a breaking change, because previously a symbol could be exported with export without being part of a public API. The notion of "being public" didn't even exist in Julia (on a language level, as opposed to docs) before that PR. A simple solution would have been to define public symbols as only the ones marked with public, although I guess now it may be too late for that?

This issue creates some problems for the Julia implementation itself, e.g. Core.Method is exported into Main, unintentionally (?) making it public, similarly with GenericMemory: #53854 #53971

If Julia v1.11 were released as-is, user packages would be locked into supporting undocumented exported symbols until they make a breaking release.

@nsajko nsajko added the design Design of APIs or of the language itself label Apr 6, 2024
@PallHaraldsson
Copy link
Contributor

Why is something exported if not part of the "public API"?

@stevengj
Copy link
Member

stevengj commented Apr 6, 2024

Prior to the existence of the public keyword, I think most people considered exported symbols to be part of the API of a package, covered by semantic versioning. This is consistent with the old behavior of the names(::Module) function, which listed exported names by default (and now lists public names).

See also previous discussions:

If something is exported unintentionally, is undocumented, and sees little to no use in the Julia ecosystem, there is an argument that removing the unintended export would be a minor change allowable in a 1.x release, but this would have to be argued on a case-by-case basis.

@LilithHafner LilithHafner added the kind:speculative Whether the change will be implemented is speculative label Apr 6, 2024
@LilithHafner LilithHafner added this to the 1.11 milestone Apr 6, 2024
@KristofferC
Copy link
Sponsor Member

I think it has been more or less agreed upon that exported symbols have been public. Perhaps Base has exported too much but that doesn't really change anything.

@KristofferC KristofferC removed this from the 1.11 milestone Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Design of APIs or of the language itself kind:speculative Whether the change will be implemented is speculative
Projects
None yet
Development

No branches or pull requests

5 participants