Julia: eliminate base/stdlib type piracy

Created on 15 May 2020  路  5Comments  路  Source: JuliaLang/julia

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.

breaking stdlib

Most helpful comment

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

https://github.com/JuliaLang/julia/blob/43d8a285d3f0a0a432692cbdb78f1be2ea871f81/stdlib/SparseArrays/src/sparsevector.jl#L1070

All 5 comments

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

https://github.com/JuliaLang/julia/blob/43d8a285d3f0a0a432692cbdb78f1be2ea871f81/stdlib/SparseArrays/src/sparsevector.jl#L1070

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

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.

There is #30945.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omus picture omus  路  3Comments

tkoolen picture tkoolen  路  3Comments

Keno picture Keno  路  3Comments

TotalVerb picture TotalVerb  路  3Comments

dpsanders picture dpsanders  路  3Comments