JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.59k stars 5.48k forks source link

Should `PersistentDict` and `HAMT` be public from Base or not? #53982

Open jariji opened 6 months ago

jariji commented 6 months ago

PersistentDict and HAMT were added to Base by @vchuravy in https://github.com/JuliaLang/julia/pull/51164 as part of the implementation of ScopedValues. I didn't see any discussion of whether they should be part of the public API. These days Julia is mostly moving things out of Base rather than in, so I'm bringing it up here.

What are the benefits and costs of putting these API in Base rather than

https://github.com/JuliaLang/julia/issues/53980 reports PersistentDict's now-documented examples are using Base.delete which isn't a public function.

nsajko commented 6 months ago

Neither of those are currently marked public, although I'm not sure what was the intention with Base.PersistentDict, as it's documented even though it's not public.

jariji commented 6 months ago

I see, HAMT is exported from module Base.HashArrayMappedTries which isn't itself public.

vchuravy commented 6 months ago

HAMT is decidedly not public. PersistentDict should probably be, following ImmutableDict