# Splitting more things out of base

**URL:** <https://discourse.julialang.org/t/splitting-more-things-out-of-base/10958>\
**Category:** Internals & Design\
**Created:** [May 16, 2018, 9:05pm UTC](https://discourse.julialang.org/t/splitting-more-things-out-of-base/10958 "2018-05-16T21:05:22Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [May 17, 2018, 5:32pm UTC](https://discourse.julialang.org/t/splitting-more-things-out-of-base/10958/21 "2018-05-17T17:32:06Z")

</div>

I’m going to make the very unhelpful comment that I’m still sore about moving LinearAlgebra out. That said, if LinearAlgebra is out then the stats stuff definitely should be as well, so I definitely concur with that. The special functions should stay in though. Is `gamma` really that much less deserving of being in `Base` than `sin`?

---

<div class="post-metadata">

**Author:** ![jeff.bezanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff.bezanson/32/48_2.png) [@jeff.bezanson](https://discourse.julialang.org/u/jeff.bezanson)\
**Post date:** [May 17, 2018, 5:32pm UTC](https://discourse.julialang.org/t/splitting-more-things-out-of-base/10958/22 "2018-05-17T17:32:10Z")

</div>

> [@ScottPJones](#):
>
> so that they wouldn’t be locked down with types that aren’t so good, and can’t be changed without being a breaking change.

“Types that aren’t so good” can be fixed in many ways that aren’t breaking. They can be made thread-safe, faster, etc. “This should be moved out of Base because it isn’t thread-safe” is a weird argument—why not just fix the thread safety issue?

You can do `import StrRegex: @r_str` to change `r""` syntax to another type of Regex.

Also, shouldn’t it be possible to match a Regex with something from Strs as long as the encoding is supported? All you need is a pointer and size.

---

<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:** [May 17, 2018, 5:37pm UTC](https://discourse.julialang.org/t/splitting-more-things-out-of-base/10958/23 "2018-05-17T17:37:00Z")

</div>

> [@ExpandingMan](#):
>
> Is `gamma` really that much less deserving of being in `Base` than `sin` ?

Absolutely 🙂

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [May 17, 2018, 5:39pm UTC](https://discourse.julialang.org/t/splitting-more-things-out-of-base/10958/24 "2018-05-17T17:39:30Z")

</div>

> [@kristoffer.carlsson](#):
>
> Absolutely 🙂

lol, well, when you put it that way, it’s just hard to give a rebuttal.

Just please, for the love of god, please don’t take out the hyperbolic trig functions.

---

<div class="post-metadata">

**Author:** ![foobar\_lv2](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Post date:** [May 17, 2018, 5:41pm UTC](https://discourse.julialang.org/t/splitting-more-things-out-of-base/10958/25 "2018-05-17T17:41:21Z")

</div>

@jeff.bezanson Sorry for sounding too agitated.

No, having a global namespace for regex, lgamma, quintile, etc is not a huge catastrophe for me. The two parts I’m thinking about are (1) global identifiers like `match` name-clashing with unrelated code and (2) API discoverability and organization of documentation that mirrors the namespaces.

When reading code, it is super helpful to see from the imports at a glance which parts of documentation / context to look at. Current `Base` is large enough that I suspect many people are not aware of its entire namespace / exports (I’m not!), and I don’t like this state of affairs. Then it is of course a matter of coding style whether to go for `import` and fully qualified names or `using`.

I am not using julia for embedded development, so I cannot comment on which binary dependencies are a problem or not. I’m not @ScottPJones, so I won’t name-clash with `Regex` or `r_str`, but I do name-clash with `match` (graph theoretical matching). And I use Regex rarely enough that my code would become more readable to me if I used `Regex.match` instead of unqualified `match` (because this makes the context clear).

---

<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:** [May 17, 2018, 5:51pm UTC](https://discourse.julialang.org/t/splitting-more-things-out-of-base/10958/26 "2018-05-17T17:51:15Z")

</div>

> [@jeff.bezanson](#):
>
> “Types that aren’t so good” can be fixed in many ways that aren’t breaking. They can be made thread-safe, faster, etc.

The real problem was the API, that they depend on a global value, and that people have had to play tricks that violate the idea of numbers being immutable in order to achieve adequate performance because of that API.  
That is something that cannot be changed in a non-breaking fashion.

---

<div class="post-metadata">

**Author:** ![foobar\_lv2](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Post date:** [May 17, 2018, 5:53pm UTC](https://discourse.julialang.org/t/splitting-more-things-out-of-base/10958/27 "2018-05-17T17:53:43Z")

</div>

Why are you sore about moving LinearAlgebra out?

That is, what is the problem of `using LinearAlgebra` or `using SpecialFunctions`? I know that I rarely use the special functions, and if I do then `SpecialFunctions.gamma` would be a better name than `gamma` in such contexts: `gamma` invokes connotations with so many parameters that are also called `gamma` in the literature, same for `beta` which is a very natural name for parameters for unicode-haters. Prepending the module name makes the context abundantly clear and is much more readable when the special function is invoked at very few positions in the code. Same for `svd`: `LinearAlgebra.svd` is instantly clear; code that is not actually about linear algebra, but only uses linear algebra at some few points becomes so much more readable when the mental context-switch is explicit.

---

<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:** [May 17, 2018, 5:53pm UTC](https://discourse.julialang.org/t/splitting-more-things-out-of-base/10958/28 "2018-05-17T17:53:53Z")

</div>

> [@jeff.bezanson](#):
>
> Also, shouldn’t it be possible to match a Regex with something from Strs as long as the encoding is supported? All you need is a pointer and size.

Take a look at what I had to do in `StrRegex.jl` to support different encodings and code unit sizes.  
`Regex` simply is not designed to handle all the different cases, you basically have to use the `String` type.  
`RegexStr` would be pretty much a drop in replacement, and _does_ handle those issues.

[Previous page](https://discourse.julialang.org/t/splitting-more-things-out-of-base/10958.md?page=1)
