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

rethinking Base.package_list #6873

Closed
StefanKarpinski opened this issue May 16, 2014 · 5 comments
Closed

rethinking Base.package_list #6873

StefanKarpinski opened this issue May 16, 2014 · 5 comments
Assignees
Labels
design Design of APIs or of the language itself packages Package management and loading
Milestone

Comments

@StefanKarpinski
Copy link
Member

Package list is currently a map from absolute file paths to a floating-point load time:

julia> using DataFrames

julia> Base.package_list
["/Users/stefan/.julia/Reexport/src/Reexport.jl"=>1.400267862075036e9,
 "/Users/stefan/.julia/StatsBase/src/StatsBase.jl"=>1.400267862131899e9,
 "/Users/stefan/.julia/SortingAlgorithms/src/SortingAlgorithms.jl"=>1.400267864475314e9,
 "/Users/stefan/.julia/GZip/src/GZip.jl"=>1.400267864386872e9,
"/Users/stefan/.julia/DataFrames/src/DataFrames.jl"=>1.400267862040832e9,
"/Users/stefan/.julia/DataArrays/src/DataArrays.jl"=>1.400267862631807e9]

This made sense originally, but it's a bit weird now. This should probably be a map from package names to the file that was loaded, maybe paired with its load time. It should also be exported with a name like LOADED (to correspond with LOAD_PATH).

This is coming up now because I want to close the package interactions issue and the natural way to do that would be to have a map from package names to thunks to call and just let the programmer manipulate that map. Something like this:

LOAD_HOOKS["Color"] = function()
  # stuff to do when the Color package is loaded
end
@IainNZ
Copy link
Member

IainNZ commented May 16, 2014

Is this map how you keep track of the sequence packages were loaded?

@StefanKarpinski
Copy link
Member Author

It used to be used to decide whether to reload something or not but we don't do that anymore (it never worked very well anyway).

@vtjnash
Copy link
Member

vtjnash commented May 17, 2014

Is it coincidence that I was working on #6195 tonight (which is a version of LOAD_HOOKS which avoids needing to use eval, so it should be possible to statically compile the result)?

@vtjnash
Copy link
Member

vtjnash commented Mar 25, 2016

related: #12381

@StefanKarpinski StefanKarpinski added design Design of APIs or of the language itself and removed needs decision A decision on this change is needed labels Sep 13, 2016
@StefanKarpinski StefanKarpinski added this to the 0.6.0 milestone Sep 13, 2016
@StefanKarpinski StefanKarpinski self-assigned this Sep 13, 2016
@StefanKarpinski StefanKarpinski added the packages Package management and loading label Sep 13, 2016
@StefanKarpinski StefanKarpinski modified the milestones: 1.0, 0.6.0 Nov 10, 2016
@StefanKarpinski
Copy link
Member Author

Has been rethought in the sense that it's gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Design of APIs or of the language itself packages Package management and loading
Projects
None yet
Development

No branches or pull requests

3 participants