Ark icon indicating copy to clipboard operation
Ark copied to clipboard

Virtual Environment (venv)

Open SuperFola opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. This is linked to our package manager, https://github.com/ArkScript-lang/nuclear. We should be able to create virtual environment to have (mostly) multiple versions of the lib/ folder, where the modules (standard ones and packages' ones) and code (same) are located.

Describe the solution you'd like A command, either in ark (I don't like this), in nuclear (better), or external script (neutral), to create a folder in the current directory with the current ark binary and a copy of a fresh lib/ folder (only the standard files), plus a script to activate the virtual environment. Said script should keep the old value of ARKSCRIPT_PATH (environment variable) in a file, to restore it when deactivate the venv, then set a new one pointing to $(pwd)/venv/.

Describe alternatives you've considered None because it doesn't exist yet.

Maybe we could have just cp the lib/ folder ourselves and use the flag --lib of ark to use another lib folder, but that's quite heavy and error prone (eg if you forget it or don't give the right path).

Additional info This could be a RFC, I'm just throwing an idea here because it would be a nice feature to have. Also, even though the issue is on this repo, it can be implemented elsewhere, we need to discuss about that if it's really interesting.

SuperFola avatar May 28 '21 10:05 SuperFola