JuliaLang / Juleps

Julia Enhancement Proposals
Other
67 stars 24 forks source link

Pkg3: allow upgrading and removing packages from REPL #7

Open nalimilan opened 7 years ago

nalimilan commented 7 years ago

When the user wants to remove package or update packages from an environment, they will instead invoke an external package management mode (julia --pkg?), which makes it clear that changes will not affect any currently running Julia sessions. The impact on usability is a strict improvement:

  • Adding packages and loading them is easier since one simply does using XYZ and answers interactive prompts.
  • Removing and upgrading packages is no less difficult since it previously required restarting the current Julia process anyway, and is less confusing since the requirement to restart is explict since running a separate process clearly doesn't affect the current one.

Using the command line to manage packages sounds like a usability loss to me. This will particularly be the case for Windows users.

I think we should keep the current Pkg.* functions. They should simply print a warning or ask to restart when modified packages are currently loaded.

tbreloff commented 7 years ago

I don't think "invoke an external package management mode" necessarily means you have to type commands into another prompt. In my mind this entails spinning up another process with some sort of IPC communication. You could still do Pkg.rm in the current process but it would send that command to a "package management process". Doing using XYZ when XYZ isn't installed could:

For other commands, nothing would happen after the request is sent to the package management process. The filesystem/etc might change, but nothing in your current Julia session.

StefanKarpinski commented 7 years ago

Right – I think there would be less potential for confusion and problems if package management operations don't actually take place in the current process. If you want to use and uninstalled package, you would invoke the installation command, wait on it to complete, and then load the installed package. I also think that a pkg> REPL mode would be really handy.

ChrisRackauckas commented 7 years ago

Yes, a pkg> REPL mode sounds like a perfect middleground.

tkelman commented 7 years ago

there would be less potential for confusion and problems if package management operations don't actually take place in the current process

Why, exactly? What problem does this solve? If an existing version of a package is already loaded, modifying it in a different process doesn't make the situation any less confusing unless you warn or force a restart of the process that has loaded the old version.