`Base.rand` but `Random.rand!`?

Yes, fair enough, I’ll try to focus on the bright side of it. Seems like MATLAB philosophy has some how infected us.

I use linear algebra, random and statistics stuff all the time. And I’m used to Matlab. But I really don’t get the problem with this.

For interactive use you put using... in startup.jl. For library code, using-statements are completely natural.

And it’s not like in python where everyday functionality is hidden three levels deep in 40 different packages. You just need to import a few broad packages, and your set.

Keep in mind that you can put using Random in your ~/.julia/config/startup.jl file and then never need to think about this again. Of course, in code that creates modules that want to use Random you still need this, but that seems like a place where it’s a good thing to be explicit about which parts of the stdlib you do and don’t depend on.

3 Likes

Yes, I do it all the time. My startup.jl includes:

using LinearAlgebra, Statistics, Random

Only today did I have a problem installing one package and was forced to disable silent Statistics just during the install and added it explicitly.

So what’s the problem?

Only today did I have a problem installing one package and was forced to disable silent Statistics just during the install and added it explicitly.

I think we recently changed package building to ignore startup.jl which it should have done in the first place, but now that this is fixed it shouldn’t be an issue anymore.

1 Like

I’ll admit that it’s mostly psychological. One of the beautiful things about Julia is that it takes things like linear algebra seriously. I remember how unamused I was when I first started learning to program and I realized A*B wasn’t matrix multiplication. Then people told me about Python and numpy I thought “Oh, a high level programming language! So happy that multiplication will finally be multiplication and that there are objects in the base language that behave like some reasonable approximation of vectors and matrices, if not higher rank tensors!” :unamused: (and of course all that stuff is there, it’s just not bound to the operators like it should be)

The idea that there is some wise-guy out there who thinks that linear algebra is a “niche discipline” just seems offensive, especially if you think that he is developing the programming language that you are going to be using. (I’m pleased to say that I’m quite convinced that the Julia devs take linear algebra deadly seriously.)

So yeah, I’ll fully admit it, it’s mostly psychological.