Skip to content

Dependency tree of stdlibs #25951

@KristofferC

Description

@KristofferC

Below is the dependency graph of our stdlib:

screen shot 2018-02-08 at 14 29 31

There are a few unfortunate dependencies. One for example is the Test --> Distributed --> LinearAlgebra, which means that you cannot use the Test stdlib without having the LinearAlgebra stdlib.
Perhaps some refactorings to avoid this would be useful. Test uses only myid from Distributed for example.

Figure created with:

cd("/Users/kristoffer/julia/stdlib")
import TOML
using LightGraphs
using TikzGraphs
using TikzPictures

const STDLIB_DIR = "."
const STDLIBS = readdir(STDLIB_DIR)
deps = Dict{String, Int}()
for (i, stdlib) in enumerate(STDLIBS)
    deps[stdlib] = i
end
g = LightGraphs.SimpleGraphs.SimpleDiGraph(length(STDLIBS))

for (i, stdlib) in enumerate(STDLIBS)
    proj = TOML.parsefile(joinpath(STDLIB_DIR, stdlib, "Project.toml"))
    if haskey(proj, "deps")
        for (stdlib_dep, uuid) in proj["deps"]
            add_edge!(g, deps[stdlib], deps[stdlib_dep])
        end
    end
end
t = TikzGraphs.plot(g, Layouts.SimpleNecklace(), STDLIBS)
TikzPictures.save(SVG("graph"), t)  

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibJulia's standard library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions