probcomp / Venturecxx

Primary implementation of the Venture probabilistic programming system
http://probcomp.csail.mit.edu/venture/
GNU General Public License v3.0
28 stars 6 forks source link

Reimplement `load` sanely #309

Open axch opened 8 years ago

axch commented 8 years ago

Right now, load is a special toplevel instruction, interpreted only by a special case in Ripl.execute_program_from_file. Can we do better?

Issue: Do we want load to remain restricted to the top level? If not, what are appropriate semantics for loading inside a nested scope?

Issue: Right now load will execute all the toplevel statements in the file being loaded, including ones that are not definitions. Do we want to replace this with an actual module system? The latter seems like a lot of work.

axch commented 8 years ago

Note: The Venture console also has a load command, which is almost the same except that it adds the loaded file to the console's list of loaded files. That modifies the prompt, and causes the file to be reloaded when the user issues the console's reload command.

vkmvkmvkmvkm commented 8 years ago

No module system for now. Happy to ditch load as an instruction but leave it in the console. ᐧ

On Mon, Jan 4, 2016 at 11:21 AM, axch notifications@github.com wrote:

Note: The Venture console also has a load command, which is almost the same except that it adds the loaded file to the console's list of loaded files. That modifies the prompt, and causes the file to be reloaded when the user issues the console's reload command.

— Reply to this email directly or view it on GitHub https://github.com/probcomp/Venturecxx/issues/309#issuecomment-168722457 .