Skip to content
Prev 6023 / 12125 Next

[R-pkg-devel] Use of `:::` in a package for code run in a parallel cluster

Without having read all of the comments already made here, but my
understanding why ::: is not allowed is because you are reaching into
the internal API that the package owner does not guarantee will exist
in the next release.  If you rely on the internal code of another CRAN
package in your CRAN package, your CRAN package might break without
your control.  This might release an avalanche of reverse package
dependencies failing on CRAN.

The only thing you can safely rely on is the API that is explicitly
*exported* by an R package.  In order for the maintainer to break that
API for reverse dependent packages, they need to go through a process
of deprecating and defuncting what they want to break/remove - a
process that involves multiple releases and often reaching out to
package maintainers and asking them to update accordingly.   CRAN runs
reverse package dependency checks making sure that a package does not
break its exported API.  If it does, it will not roll out on CRAN.
So, in that sense CRAN helps uphold the contract of the exported APIs.
In contrast, a maintainer can do whatever they want whenever they want
with their internal code/API.

With more and more packages being infrastructure packages, I think
there is room for "protected" API, which is not exported to avoid
cluttering up the search path for end-users while it yet provides a
contract toward package developers relying on it.  There are various
ways to emulate such protected APIs but we don't have a standard and
there's a risk that 'R CMD check' fails to detect when the contract is
broken (resulting in delayed run-time errors on the user end).

My $.02

Henrik

On Mon, Sep 14, 2020 at 12:06 PM David Kepplinger
<david.kepplinger at gmail.com> wrote:

Thread (17 messages)