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

RFE: an interpreted language as an intermediate language to speed up testing

Open danbst opened this issue 4 years ago • 5 comments

Rust IM language is quite slow on recompiles, which is frustrating. Maybe it's possible to build template in an interpreted language (say, Python)?

This would be fine for newcomers/tutorial/CLI cases. The Rust IM language can be used for release/embedded builds though.

I understand this is quite a lot of duplication, but maybe it can be reduced with FFI to Rust non-generated objects.

danbst avatar Mar 15 '20 11:03 danbst

Yep, this is something we've been talking about for a while. You're right, much of the template code, in particular everything inside the differential_datalog crate is static and can be reused in the interpreted version. Most of the Haskell compiler logic can likewise be reused.

We just need to find the time to build (and maintain) this, which might take a while :)

ryzhyk avatar Mar 15 '20 15:03 ryzhyk

PS. As mentioned in my other message, compilation times are much more tolerable now that we are taking advantage of incremental compilation, which is another reason this is not at the top of our todo list.

ryzhyk avatar Mar 15 '20 15:03 ryzhyk

as a newbie to Rust, could you elaborate on what kind of commands you normally run for incremental compilation? Thanks.

RAbraham avatar Apr 03 '20 13:04 RAbraham

You don't need to do anything to take advantage of incremental compilation. As you change your DDlog program and run ddlog on it, the DDlog compiler will modify affected Rust source files. As you then run cargo on the generated Rust project, it will reuse results of previous compilations. In my experience, while the first compilation usually takes a few minutes, small changes to DDlog tend to take less than a minute to recompile (often, much less for smaller programs).

ryzhyk avatar Apr 03 '20 19:04 ryzhyk

thanks, I'll do so.

RAbraham avatar Apr 09 '20 16:04 RAbraham