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

script loading experiments (experimental) #426

Closed
wants to merge 2 commits into from
Closed

script loading experiments (experimental) #426

wants to merge 2 commits into from

Conversation

@pq
Copy link
Collaborator

@pq pq commented Jun 13, 2018

(experimental)

replacing dofile with loadfile allows us to pass an env into which script globals get loaded. this experiment introduces a simple proxy env that is essentially a pass-through to _G. minimally, this proxy gives us hooks to monitor or police global access and (re)definition. taking it further we could consider expanding on this approach in the service of sandboxing #258.

anyway, this is more modest than that. as a drop-in replacement for our current dofile approach it should “just work” and gives us the opportunity to at least report un-toward re-writes of globals (see: #425).

note: i’m not proposing this land as is but rather see it as food for thought. hoping it moves the conversation along.

/cc @catfact @ngwese @tehn

@pq pq added the do not merge label Jun 13, 2018
@pq pq mentioned this pull request Jun 13, 2018
@pq
Copy link
Collaborator Author

@pq pq commented Jun 13, 2018

for context, here's output for running 16sliders.lua

norns.script.load("study/16sliders.lua")
# script load
# cleanup
# script clear
*** written globals:
redraw
key
init
enc
# script run
@tehn
Copy link
Member

@tehn tehn commented Sep 21, 2018

#436 instead

@tehn tehn closed this Sep 21, 2018
@tehn tehn deleted the script_loading branch Sep 21, 2018
@pq pq mentioned this pull request Sep 21, 2018
4 of 6 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants