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: defaults of open vs closed #1

Closed
tkelman opened this issue Oct 21, 2016 · 3 comments
Closed

Pkg3: defaults of open vs closed #1

tkelman opened this issue Oct 21, 2016 · 3 comments
Labels

Comments

@tkelman
Copy link

tkelman commented Oct 21, 2016

Specifically with respect to

When started in interactive mode, Julia defaults to open; when started non-interactively, it defaults to closed.

So for code that depends on modules available via "open" mechanisms like LOAD_PATH, starting julia interactively and running include("script.jl") will work but julia script.jl will not?

This seems like it would be a major gotcha, I don't think interactivity is a good proxy for whether people want to be permissive about code loading or have a locked-down reproducible environment. (It is a good criteria for whether or not to enable user-prompting behavior though.)

@StefanKarpinski
Copy link
Sponsor Member

I had thought about making include locked down too. What criterion would make sense?

@tkelman
Copy link
Author

tkelman commented Oct 21, 2016

Something that can be uniformly opted into (when desired) in either interactive mode or script mode, probably with the same default for both. It's not a very satisfying answer, but command-line flag and/or language-level API - global or scoped constructs for changing permissiveness mode? Making code loading differ between REPL and scripts by default would be a departure.

There is value to having both permissive and strict modes for code loading, but making strict the default would mean you need solid tooling to get much done. Pkg3 environments will provide that tooling, but seem like a feature that you shouldn't need to think too hard about until you're really deploying Julia code. I think that could make for more of a hurdle than the current transition from REPL code to script.

I see people write single-file modules and do push!(LOAD_PATH, pwd()) pretty often, and I don't think they'll want to worry about modifying a toml file to get that to work when run in a script.

@StefanKarpinski
Copy link
Sponsor Member

I guess the only time you really need strict mode to make sure you haven't used something that you didn't save in the current environment is when you're running tests, so as long as tests run in strict mode, it should be ok.

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

2 participants