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

Pkg3: Environment manipulation in the language instead of with command line arguments #5

Open
tkelman opened this issue Oct 22, 2016 · 3 comments
Labels

Comments

@tkelman
Copy link

tkelman commented Oct 22, 2016

If environment manipulation gets moved to a command-line invocation, people are probably going to want to run it most often from shell mode or via run(), which isn't any better than what we have now. Otherwise many Windows users aren't going to find it at all because the usual workflow there is often not via the command line. (IDE features can help, but shouldn't be required for this to be usable.)

As a thought, what if we make this tie into JuliaLang/julia#17997 instead? Instead of loading packages into Main, load them into an environment-specific namespace. Enter and leave environments via Pkg3.enterenv("newenv"), Pkg3.leaveenv() etc. Make Pkg3.add, Pkg3.rm, and Pkg3.update take an environment argument. If the user attempts to update or remove a loaded package from an environment, that environment needs to be reset via something similar to workspace().

@StefanKarpinski
Copy link
Member

That seems like a good idea although I'm a little skeptical about feasibility and to some extent usability. Can we have two completely unrelated environments in the same process at the same time? What if they use different versions of the same shared libraries? The workspace mechanism doesn't seem like it's been wildly successful in terms of usability and this seems a bit like that but more complex. Isn't independent processes a better, simpler, easier-to-implement model for this sort of thing?

@ChrisRackauckas
Copy link
Member

ChrisRackauckas commented Oct 24, 2016

The workspace mechanism doesn't seem like it's been wildly successful in terms of usability and this seems a bit like that but more complex. Isn't independent processes a better, simpler, easier-to-implement model for this sort of thing?

Juno has already gone the way of independent processes, implementing a process server so that way new processes open up instantly. This is something that seems to work very well, getting the "instant" response time while getting a truly cleared workspace. If the REPL acted the same that would be nice.

@tkelman
Copy link
Author

tkelman commented Oct 24, 2016

You don't get any benefit from package management being an independent process if most users will want to run it from inside Julia most of the time. Upgrading happens often, removing occasionally. Both are safe if the packages they modify aren't currently loaded. They're only potentially problematic if the package is currently loaded. Rather than inconvenience everyone all of the time, I think it would be better to just warn on potentially problematic cases, like the loaded-in-memory version of a package no longer matching what's installed.

Environments might need to be separate processes, but they should be launchable and configurable from within the language. Anything you can't do from within the repl is going to rule it out from a large group of users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants