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

Document what public API means #35715

Merged
merged 4 commits into from
Apr 20, 2021
Merged

Document what public API means #35715

merged 4 commits into from
Apr 20, 2021

Conversation

tkf
Copy link
Member

@tkf tkf commented May 3, 2020

I think there is confusion in Julia community for what it means to be a public API. I think clarifying it in documentation makes sense.

Closes #7561.

@stev47
Copy link
Contributor

stev47 commented May 4, 2020

Sometimes the manual mentions "internal" methods (e.g. methods starting with underscore in the chapter on methods). Maybe one could clarify that apparently "non-internal" does not mean "public".

@JeffBezanson
Copy link
Sponsor Member

👍 to adding this. I'm sure @StefanKarpinski will want to weigh in.

@StefanKarpinski
Copy link
Sponsor Member

This feels a little too restrictive. People can rely on internal code if they want to, but they just need to be aware that we may change it and break their code. If they're ok with that, then carry on. But if they find it useful then someone else may as well, so it would be helpful if they would open an issue to figure out a way to expose the functionality in some official way.

doc/src/manual/faq.md Outdated Show resolved Hide resolved
doc/src/manual/faq.md Outdated Show resolved Hide resolved
@stev47
Copy link
Contributor

stev47 commented May 5, 2020 via email

@tkf
Copy link
Member Author

tkf commented May 5, 2020

I'd say "internal" is exactly the complement of "public".

If so, could you then change the corresponding wording about "internal methods" in the manual section about methods?

I'm not sure what is inconsistent with the part you linked. If you think you have a better wording in that part, the best way is to open an PR. It's touching a different part of the documentation so it can be discussed independently.

It is assumed to be an internal marker in a lot of other programming languages

Yes, it is "assumed" to be; but not always true. In a lot of programming languages it is used in public interface when it's doing something tricky (an example in Python; an example in C).

So looking from the other side: exported functions that are not documented are not considered public?

You have to declare public API to use SemVer. That's the very first thing mentioned in SemVer spec. Writing documentation is more or less the only way to declare public API in Julia at the moment (it'd be nice to improve this, of course). export alone does not mean anything because it doesn't tell you what interface the exported names satisfy.

Obviously, I'm only describing an ideal case. In practice, you may be able to rely on kindness of the library authors to avoid abrupt change in not-strictly-stable API.

@stev47
Copy link
Contributor

stev47 commented May 6, 2020 via email

@JeffBezanson
Copy link
Sponsor Member

Writing documentation is more or less the only way to declare public API in Julia at the moment (it'd be nice to improve this, of course). export alone does not mean anything

I don't think this is entirely true; anything exported should be considered public, and it's considered a bug for an exported identifier not to have documentation. But even if an exported name didn't have documentation, it would at least need to remain exported and do something like what it did before to avoid breaking code.

@tkf
Copy link
Member Author

tkf commented May 6, 2020

Yes, I agree that's the best action once undocumented export names are found.

doc/src/manual/faq.md Outdated Show resolved Hide resolved
@mbauman
Copy link
Sponsor Member

mbauman commented May 8, 2020

Fun fact: merging this would close the least-recently-updated open issue (#7561).

@tkf tkf requested a review from StefanKarpinski May 13, 2020 14:26
@ViralBShah ViralBShah added the docs This change adds or pertains to documentation label May 14, 2020
@ViralBShah
Copy link
Member

Bump. This would be nice to get merged and feels like we are close.

@vtjnash vtjnash merged commit bb5b98e into JuliaLang:master Apr 20, 2021
@vtjnash
Copy link
Sponsor Member

vtjnash commented Apr 20, 2021

I can't see any reason not to have merged this.

ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
Provides some guidelines, in addition to those added recently by JuliaLang#40533 to the style-guide, per JuliaLang#7561.
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
Provides some guidelines, in addition to those added recently by JuliaLang#40533 to the style-guide, per JuliaLang#7561.
johanmon pushed a commit to johanmon/julia that referenced this pull request Jul 5, 2021
Provides some guidelines, in addition to those added recently by JuliaLang#40533 to the style-guide, per JuliaLang#7561.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

document conventions about public vs private API
9 participants