# \[ANN\] Numerics.jl – The Extended Standard Library

**URL:** <https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694>\
**Category:** Package Announcements\
**Created:** [June 3, 2020, 8:36pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694 "2020-06-03T20:36:55Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 4, 2020, 5:06pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/21 "2020-06-04T17:06:17Z")

</div>

I would say plain `using X` would do.  
In `.julia/config/startup.jl` put:

```julia
using StaticArrays
println("You are welcome!")

```

EDIT: Better is

```julia
atreplinit() do repl
    try
        @eval using Revise
        @async Revise.wait_steal_repl_backend()
    catch e
        @warn(e.msg)
    end
    try
        @eval using StaticArrays
    catch e
        @warn(e.msg)
    end
end

```

Refer to [Configuration · Revise.jl](https://timholy.github.io/Revise.jl/stable/config/#Using-Revise-by-default-1)

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [June 4, 2020, 5:34pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/22 "2020-06-04T17:34:50Z")

</div>

I’m beginning to think this was a bad idea. What’s needed is a package that lets you search available packages by functionality/keywords.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [June 4, 2020, 5:38pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/23 "2020-06-04T17:38:07Z")

</div>

Like this?

[https://juliahub.com/ui/Packages](https://juliahub.com/ui/Packages)

---

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [June 4, 2020, 5:43pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/24 "2020-06-04T17:43:38Z")

</div>

It’d be nice if there were a way to aggregate the public APIs of packages so one could search by function / method:

“Where is that `eigs()` function anyway?”

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [June 4, 2020, 5:50pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/25 "2020-06-04T17:50:08Z")

</div>

No something you can invoke from the REPL like

Pkg.search(:optimize)  
Pkg.search(“Bayesian”)  
Pkg.search(“convolution”)

or similar to what @anon94023334

---

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [June 4, 2020, 6:32pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/26 "2020-06-04T18:32:06Z")

</div>

But that means it is always loaded right. Is there a way for that not to be the case?

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 4, 2020, 6:39pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/27 "2020-06-04T18:39:34Z")

</div>

That’s why I suggested the private module in your repo. For each project you can have one of these and load them with a single `using`.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [June 4, 2020, 7:07pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/28 "2020-06-04T19:07:24Z")

</div>

What’s the effective difference between putting `using StaticArrays` into `atreplinit` and making it a top-level statement in `startup.jl`?

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [June 4, 2020, 7:18pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/29 "2020-06-04T19:18:20Z")

</div>

`atreplinit` is not executed when running Julia non-interactively

---

<div class="post-metadata">

**Author:** ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Post date:** [June 4, 2020, 8:27pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/30 "2020-06-04T20:27:31Z")

</div>

Here are the first few lines of my startup.jl file. This has been working fine for me. Have I missed something?

> using LinearAlgebra  
> using SuiteSparse  
> using SparseArrays  
> using AbstractFFTs  
> using FFTW  
> using IJulia  
> using JLD2

---

<div class="post-metadata">

**Author:** ![kdzhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kdzhang/32/11696_2.png) [@kdzhang](https://discourse.julialang.org/u/kdzhang)\
**Post date:** [June 5, 2020, 4:42am UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/31 "2020-06-05T04:42:21Z")

</div>

I thought it was there: [JuliaHub](https://juliahub.com/ui/Documentation) , is this something you want?

---

<div class="post-metadata">

**Author:** ![tbo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbo/32/9357_2.png) [@tbo](https://discourse.julialang.org/u/tbo)\
**Post date:** [June 5, 2020, 5:29am UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/32 "2020-06-05T05:29:01Z")

</div>

Then your numerics must be a lot different from my numerics. Except for LinearAlgebra I do not require any of the other packages. What about FFTs, optimization, machine learning, PDE solvers,… I mean half of Julia’s ecosystem is built for doing numerics and there are probably a gazillion packages which could be useful.  
Though I respect the motivation, I think it’s a very bad idea of having a meta package with such a generic and for many people misleading name.

---

<div class="post-metadata">

**Author:** ![c42f](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c42f/32/52842_2.png) [@c42f](https://discourse.julialang.org/u/c42f)\
**Post date:** [June 5, 2020, 6:24am UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/33 "2020-06-05T06:24:29Z")

</div>

I’m also not sure this is a good idea overall unless the individual libraries are very closely related and are truly evolving together. One reason is that the library version of Numerics.jl will need to have its major version bumped any time that any of the sub-packages have their major version changed. This means the rate of breaking changes in Numerics will be rather high. Maybe that’s not a problem for “convenience use” from the REPL. But I worry it will introduce a lot of unnecessary constraints into the graph of compatible package versions if people start to depend on Numerics.

We had a somewhat similar problem recently where CoordinateTransformations.jl was updated to no longer re-export symbols from Rotations.jl. The new setup is better with less version constraints, but transitioning led to some compatibility oddities which one normally doesn’t need to deal with.

---

<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 5, 2020, 7:07am UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/34 "2020-06-05T07:07:17Z")

</div>

> [@c42f](#):
>
> One reason is that the library version of Numerics.jl will need to have its major version bumped any time that any of the sub-packages have their major version changed.

Well, this is “circumvented” by not having any compat info at all in Numerics.jl.

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [June 6, 2020, 4:03pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/35 "2020-06-06T16:03:12Z")

</div>

> [@c42f](#):
>
> One reason is that the library version of Numerics.jl will need to have its major version bumped any time that any of the sub-packages have their major version changed.

Might be neat to have a way for a package to be “terminal” - that is, something that no registered package should depend on. Something like this seems fine for interactive use (I agree that using up the name isn’t great), but if you’re writing a package, you should explicitly depend on the underlying packages.

I don’t know how that would be feasible, since you’d need to allow it to be included in a Project.toml, but maybe this could be at the level of the registry?

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [June 6, 2020, 6:47pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/36 "2020-06-06T18:47:45Z")

</div>

Speaking of naming, I have no idea how packages are registered, but is there no moderation of that process?? What keeps a malicious actor from submitting 120,000 packages each with a different english dictionary word as their name and no useful content? Just out of curiosity.

Looking it up: [GitHub - JuliaRegistries/RegistryCI.jl: Continuous integration (CI) tools for Julia package registries, including registry consistency testing, automatic merging (automerge) of pull requests, and automatic TagBot triggers](https://github.com/JuliaRegistries/RegistryCI.jl#automatic-merging-guidelines)

It looks like it is theoretically possible for a malicious actor to register a lot of packages with a lot of dictionary words through the automated system. (note, I’m not saying Numerics was at ALL a malicious case, it just made me think about naming, and the internet these days is a place where you always need to assume there exists a malicious actor who might try to exploit every automated system. I spend a bunch of time helping people with their OpenWrt routers for example and am struck by how many portscans hit routers every hour).

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [June 6, 2020, 7:26pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/37 "2020-06-06T19:26:56Z")

</div>

There is a three day waiting period. If someone tried, I’m sure there would be manual intervention during that time frame.

---

<div class="post-metadata">

**Author:** ![c42f](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c42f/32/52842_2.png) [@c42f](https://discourse.julialang.org/u/c42f)\
**Post date:** [June 7, 2020, 4:04am UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/38 "2020-06-07T04:04:11Z")

</div>

> [@kevbonham](#):
>
> if you’re writing a package, you should explicitly depend on the underlying packages.

I think even ad-hoc analysis scripts should come with a Manifest.toml, otherwise they are guarenteed to get out of date with the installed packages and become non-reproducible.

That’s not to say end users should have to think about this on average, rather the tooling should make it _so easy_ that it happens by default. I feel part of doing that might be to embed the environment in the script somehow to make it a single file, maybe something like [GitHub - c42f/CodeEnvironments.jl: Julia Pkg environments which can be embedded in julia code](https://github.com/c42f/CodeEnvironments.jl).

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [June 7, 2020, 11:34am UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/39 "2020-06-07T11:34:17Z")

</div>

> [@c42f](#):
>
> I think even ad-hoc analysis scripts should come with a Manifest.toml, otherwise they are guarenteed to get out of date with the installed packages and become non-reproducible.

I agree completely. When I say ‘interactive use’, I also mean projects where you’re going to save the Project.toml and Manifest.toml and your analysis code. When I say a package shouldn’t depend on this, I mean “package” in the strict sense, something that’s intended for `using` by sometime else. My point was addressed at your idea that you’d need to constantly bump the version of the meta package. I was thinking that, if the meta package is “terminal,” its bounds for its own dependences could be much more loose, perhaps not even having version bounds.

In other words `]add Numerics` should just be like an alias for `]add All The Packages` (and the same for `using`). It doesn’t add any functionality, so it’s version has no meaning beyond the version of it’s underlying packages, and the version **bounds** of the packages it reports should be sufficient to reason about compatibility. BUT, it wouldn’t do for this kind of pass through to propagate further.

---

<div class="post-metadata">

**Author:** ![c42f](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c42f/32/52842_2.png) [@c42f](https://discourse.julialang.org/u/c42f)\
**Post date:** [June 7, 2020, 12:12pm UTC](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694/40 "2020-06-07T12:12:38Z")

</div>

> [@kevbonham](#):
>
> In other words `]add Numerics` should just be like an alias for `]add All The Packages` (and the same for `using` ). It doesn’t add any functionality, so it’s version has no meaning beyond the version of it’s underlying packages, and the version **bounds** of the packages it reports should be sufficient to reason about compatibility. BUT, it wouldn’t do for this kind of pass through to propagate further.

Oh that’s interesting. It’s more like a way to seed a new environment with a bunch of packages? So it sounds to me that this might actually be quite useful, but it’s not exactly a package? More like having a reference environment which you can copy. Something vaguely like

```julia
pkg> add PkgA
pkg> add PkgB
pkg> ...
pkg> env save my_standard_env

```

later…

```julia
pkg> add my_standard_env
pkg> using my_standard_env # ? maybe a bad idea

```

[Previous page](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694.md?page=1)

[Next page](https://discourse.julialang.org/t/ann-numerics-jl-the-extended-standard-library/40694.md?page=3)
