differential-datalog icon indicating copy to clipboard operation
differential-datalog copied to clipboard

Add an "import" cli command

Open mihaibudiu opened this issue 5 years ago • 5 comments

This should load the contents of another CLI command file.

mihaibudiu avatar May 08 '19 22:05 mihaibudiu

If we do this we have to think about what "exit" means in an imported script.

mihaibudiu avatar May 08 '19 22:05 mihaibudiu

More info on this issue:

This will allow .dat files to import commands from other .dat files, which will improve the record/replay infrastructure. For example, at the moment, to replay a program from a snapshot, both the snapshot and subsequent commands must be in the same file. With this feature, the replay file can simply import the snapshot file.

Another use case is when using the interactive command prompt for debugging. The user may want to load a large number of commands from a file and then type a few commands manually to change or dump some of the relations.

ryzhyk avatar Oct 10 '19 16:10 ryzhyk

There is another very important use case: when you test multiple programs as modules you can import their command files. The Souffle tests work like that.

mihaibudiu avatar Oct 10 '19 16:10 mihaibudiu

Good point. This means that the import command will have to support namespace argument.

ryzhyk avatar Oct 10 '19 16:10 ryzhyk

I'm working on this and approximately halfway though already. I hope to finish it within a week or so.

smadaminov avatar Jun 12 '21 03:06 smadaminov