# Reserving names in Base

**URL:** <https://discourse.julialang.org/t/reserving-names-in-base/11390>\
**Category:** Internals & Design\
**Created:** [June 3, 2018, 3:21pm UTC](https://discourse.julialang.org/t/reserving-names-in-base/11390 "2018-06-03T15:21:27Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![Per](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/per/32/10387_2.png) [@Per](https://discourse.julialang.org/u/Per)\
**Post date:** [June 4, 2018, 7:53am UTC](https://discourse.julialang.org/t/reserving-names-in-base/11390/21 "2018-06-04T07:53:58Z")

</div>

> [@foobar\_lv2](#):
>
> If no suitable name / abstract interface exists in Base, then, well, as far as I understood there needs to be a `fooBase` package

This is not strictly true. Even if there is no `foo` in `Base`, I can still do

```julia
@eval Base foo(x::MyType) = ...

```

which will extend the function `Base.foo` for `MyType`, or create it if it did not exist.

I’m not saying this is a good idea, I’m just saying it is possible, so there’s no need to pre-emptively reserve names.

> [@foobar\_lv2](#):
>
> Even having a `Misc` stdlib with submodules like `Misc.geometry` is enough for having a coordination point for package authors (that is not `fooBase` with the possibility of competing `fooBase` s ).

This is ultimately a question of who will do the maintenance work. Something that goes into a standard library would ultimately be maintained by the core Julia team, while competing `fooBase` packages can be maintained by anyone. While I believe that the core team would do an excellent job, I also suspect that they need to eat and sleep sometimes, just like mortals. So the best approach might be to first develop `fooBase` independently and then once it is stable, and if it reaches wide adoption, politely ask if they would consider taking ownership.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [June 4, 2018, 7:59am UTC](https://discourse.julialang.org/t/reserving-names-in-base/11390/22 "2018-06-04T07:59:09Z")

</div>

Also, putting things in `Base` also implies changes at the release frequency. Packages can be much more agile.

> [@Per](#):
>
> I also suspect that they need to eat and sleep sometimes, just like mortals.

While I am not suggesting that this is necessarily true, I also heard that some of them also have jobs.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [June 4, 2018, 2:49pm UTC](https://discourse.julialang.org/t/reserving-names-in-base/11390/23 "2018-06-04T14:49:12Z")

</div>

Perhaps a package in stdlib?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 4, 2018, 3:12pm UTC](https://discourse.julialang.org/t/reserving-names-in-base/11390/24 "2018-06-04T15:12:07Z")

</div>

Perhaps a package outside stdlib?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [June 4, 2018, 3:29pm UTC](https://discourse.julialang.org/t/reserving-names-in-base/11390/25 "2018-06-04T15:29:01Z")

</div>

> [@kristoffer.carlsson](#):
>
> Perhaps a package outside stdlib?

Thats a good idea, perhaps something like `*Base` packages, which is common in e.g. the [Julia Language](https://julialang.org/). Maybe we can adopt that pattern? Some examples:

- [`StatsBase`](https://github.com/JuliaStats/StatsBase.jl)
- [`DiffEqBase`](https://github.com/JuliaDiffEq/DiffEqBase.jl)
- [`NLSolversBase`](https://github.com/JuliaNLSolvers/NLSolversBase.jl)
- [`OnlineStatsBase`](https://github.com/joshday/OnlineStatsBase.jl)
- [`RecipesBase`](https://github.com/JuliaPlots/RecipesBase.jl)
- [`MathProgBase`](https://github.com/JuliaOpt/MathProgBase.jl)
- …  
:troll:

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [June 4, 2018, 4:14pm UTC](https://discourse.julialang.org/t/reserving-names-in-base/11390/26 "2018-06-04T16:14:29Z")

</div>

> [@fredrikekre](#):
>
> Thats a good idea, perhaps something like `*Base` packages, which is common in e.g. the [Julia Language](https://julialang.org/). Maybe we can adopt that pattern? Some examples:

Actually, I think an even lower level might be better for this.

I made a separate [StrAPI.jl](https://github.com/JuliaString/StrAPI.jl) that has just the API (empty functions and trait definitions), using [ModuleInterfaceTools.jl](https://github.com/JuliaString/ModuleInterfaceTools.jl) to simplify the task of a number of packages implementing different composable pieces of a common API.

[StrBase.jl](https://github.com/JuliaString/StrBase.jl) and [ChrBase.jl](https://github.com/JuliaString/ChrBase.jl) then extend the functions, and set up the basic types (`Str` and `Chr`), and add the appropriate traits for the “built-in” Str and Chr types (i.e. `ASCIIChr`, `LatinChr`, `UCS2Chr`, `UTF32Chr`, `ASCIIStr`, `LatinStr`, `UCS2Str`, `UTF32Str`, `UTF8Str`, `UTF16Str`, and a few more such as `BinaryStr`).

Doing that way, I think allows more flexibility for other packages that implement the API, but don’t want to use the basic types/functions defined in the \*Base packages.

---

<div class="post-metadata">

**Author:** ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)\
**Post date:** [June 4, 2018, 5:13pm UTC](https://discourse.julialang.org/t/reserving-names-in-base/11390/27 "2018-06-04T17:13:07Z")

</div>

> [@fredrikekre](#):
>
> Thats a good idea, perhaps something like `*Base` packages,

When types are required to be coordinated, a `*Base` is necessary and the various packages can work together to ensure they have the right structure. You can’t second-guess what that would look like.

… but if most of this is just about method merging, why not tackle that more head-on? In the absence of a long-run solution to having methods stay in their own namespaces, why not start with approved `@merge` macro, etc. to make things easier?

[Previous page](https://discourse.julialang.org/t/reserving-names-in-base/11390.md?page=1)
