Skip to content

Commit 85752db

Browse files
committed
Document what public API means
1 parent cf3d8b5 commit 85752db

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

doc/src/base/base.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ Some general notes:
1515
* By convention, function names ending with an exclamation point (`!`) modify their arguments.
1616
Some functions have both modifying (e.g., `sort!`) and non-modifying (`sort`) versions.
1717

18+
The behaviors of `Base` and standard libraries are stable as defined in
19+
[SemVer](https://semver.org/) only if they are documented; i.e., included in the
20+
[Julia documentation](https://docs.julialang.org/) and not explicitly marked as non-stable.
21+
See [API FAQ](@ref man-api) for more information.
22+
1823
## Getting Around
1924

2025
```@docs

doc/src/manual/faq.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,28 @@ For similar reasons, automated translation to Julia would also typically generat
1818

1919
On the other hand, language *interoperability* is extremely useful: we want to exploit existing high-quality code in other languages from Julia (and vice versa)! The best way to enable this is not a transpiler, but rather via easy inter-language calling facilities. We have worked hard on this, from the built-in `ccall` intrinsic (to call C and Fortran libraries) to [JuliaInterop](https://github.com/JuliaInterop) packages that connect Julia to Python, Matlab, C++, and more.
2020

21+
## [Public API](@id man-api)
22+
23+
### How does Julia declare public API?
24+
25+
The only interfaces that are stable with respect to [SemVer](https://semver.org/) of `julia`
26+
version are the Julia `Base` and standard libraries interfaces described in
27+
[the documentation](https://docs.julialang.org/) and not explicitly marked as non-stable.
28+
Functions, types, and constants are not part of the public API if they are not included in
29+
the documentation, _even if they have docstrings_.
30+
31+
### There is a useful undocumented function/type/constant. Can I use it?
32+
33+
Please open an [issue](https://github.com/JuliaLang/julia/issues) or
34+
[pull request](https://github.com/JuliaLang/julia/pulls) to start a discussion for turning it
35+
into a public API before relying on it.
36+
37+
### The documentation is not accurate enough. Can I rely on the existing behavior?
38+
39+
Please open an [issue](https://github.com/JuliaLang/julia/issues) or
40+
[pull request](https://github.com/JuliaLang/julia/pulls) to start a discussion for turning the
41+
existing behavior into a public API.
42+
2143
## Sessions and the REPL
2244

2345
### How do I delete an object in memory?

0 commit comments

Comments
 (0)