Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eliminate base/stdlib type piracy #35899

Closed
StefanKarpinski opened this issue May 15, 2020 · 5 comments
Closed

eliminate base/stdlib type piracy #35899

StefanKarpinski opened this issue May 15, 2020 · 5 comments
Labels
kind:breaking This change will break code stdlib Julia's standard library
Milestone

Comments

@StefanKarpinski
Copy link
Sponsor Member

There are a number of cases where stdlibs type pirate base (or vice versa, depending on how you look at it), which are grinding @KristofferC's gears, partly because it's just bad m'kay, but also because it means that you can't be sure whether a project doesn't depend on a stdlib just because it doesn't import it. One such example is here due to Base providing rand which is mostly defined in Random. Another famous example is LinearAlgebra defining * on matrices and vectors. It's probably not possible to eliminate the these piracies in the 1.x timeframe, but we should keep track of them and try to figure out what to do about this for Julia 2.0 when we can actually break some things.

@StefanKarpinski StefanKarpinski added kind:breaking This change will break code stdlib Julia's standard library labels May 15, 2020
@StefanKarpinski StefanKarpinski added this to the 2.0 milestone May 15, 2020
@KristofferC
Copy link
Sponsor Member

KristofferC commented May 15, 2020

Guess where vcat on Vectors is defined. Did you guess line 1070 in sparsevector.jl in the stdlib SparseArrays? Correct!

vcat(A::Vector...) = Base.typed_vcat(promote_eltype(A...), A...)

@StefanKarpinski
Copy link
Sponsor Member Author

Would be good to collect a list of these here to track them in once place.

@KristofferC
Copy link
Sponsor Member

There is #30945.

@JeffBezanson
Copy link
Sponsor Member

Guess where vcat on Vectors is defined.

It doesn't negate the overall point at all, but I believe that method is not actually necessary to concatenate vectors. Base also has an implementation. I believe that definition is to resolve an ambiguity perhaps.

@StefanKarpinski
Copy link
Sponsor Member Author

StefanKarpinski commented May 15, 2020

There is #30945.

Didn't realize/remember that already existed. But yes, that's already a rather comprehensive list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:breaking This change will break code stdlib Julia's standard library
Projects
None yet
Development

No branches or pull requests

4 participants