Stream: t-compiler/wg-polonius

Topic: datalog-to-datafrog


lqd (Oct 04 2019 at 02:18, on Zulip):

Ok here's the datalog-to-datafrog "prototyping compiler" PR I mentioned before: https://github.com/rust-lang/polonius/pull/132 it does help when trying out rules (or doing Demand Transformation)
I've been bitten by weirdness around write!, rustfmt and whitespace line-endings inside the macro, so I'm not sure it'll pass CI. (It does pass locally, but was having random whitespace added/removed). It's not supposed to be especially robust or anything, just giving it valid decls and rules, and it should work. (It's also inefficient & cloning strings left and right but oh well :)

let me know what you think

Albin Stjerna (Oct 04 2019 at 19:53, on Zulip):

I think it’s pretty gosh damned cool is what I think

lqd (Oct 04 2019 at 20:07, on Zulip):

(it's still very buggy but I'll fix it over time, add tests etc)

lqd (Oct 06 2019 at 17:58, on Zulip):

(yeah, maybe that should be in its own repo temporarily, until it's more stable and better tested, before being upstreamed in datafrog, so I'll close the PR for now and move it to a more appropriate location)

Albin Stjerna (Oct 07 2019 at 08:51, on Zulip):

There might even be a case for it being its own crate perhaps?

Albin Stjerna (Oct 07 2019 at 08:52, on Zulip):

That way, it could be used for code-generation as a dev-dependency like for example lalrpop

lqd (Oct 07 2019 at 13:57, on Zulip):

maybe. Although it's not a complete solution that will take all datalog programs and spit out a perfect datafrog computation (datafrog has its own limitations and API requirements), I'm mostly interested in making it easy for us to test out things in polonius. I'll put it in its own "utils" crate for the time being, maybe with some of the other hacky things from my datafrog fork (eg "datalog provenance" AKA a println for every rule firing, and a function that extracts some target tuple's provenance from this log)

lqd (Oct 07 2019 at 18:03, on Zulip):

datafrog generator moved here https://github.com/lqd/datapond @Vytautas Astrauskas

lqd (Oct 07 2019 at 18:05, on Zulip):

(I hope it helps but it's likely not going to work 100%, it's really only intended in the limited context of polonius, not every datalog computation; and even then only gets you part of the way there, you still need to know datafrog and how to set it up etc)

lqd (Oct 08 2019 at 00:47, on Zulip):

of course as soon as I add why-provenance, I actually also need why-not-provenance to understand what is going on in the flow sensitive equality variant :sweat:

Vytautas Astrauskas (Oct 08 2019 at 08:27, on Zulip):

datafrog generator moved here https://github.com/lqd/datapond Vytautas Astrauskas (I plan to dogfood it there for a while, maybe add DT to it, etc, and then see what Niko and Frank think about upstreaming those to datafrog directly)

Thanks!

Vytautas Astrauskas (Jan 09 2020 at 07:06, on Zulip):

@lqd Are you currently working on datapond?

Vytautas Astrauskas (Jan 09 2020 at 07:07, on Zulip):

I would like to start using it for my project and, therefore, would like to finish converting it into a procedural macro.

lqd (Jan 09 2020 at 07:39, on Zulip):

@Vytautas Astrauskas I have been looking at different examples to find more bugs, and fixed a few, but there are more (related to renaming/arguments and index uses, etc) — but if "currently" means "right this second" then no :) I have seen you push cool new work! I also seem to have lost the query syntax we looked at during rustfest so haven't been able to do a lot wrt syntax/parsing unfortunately (but as mentioned I wanted to try more rule examples to find bugs first)

lqd (Jan 09 2020 at 08:01, on Zulip):

(I think we’d want to test your queries before finishing the proc macro though ? Just to make sure it handles enough of what you need correctly-ish)

Vytautas Astrauskas (Jan 09 2020 at 08:55, on Zulip):

@lqd Have you pushed all your changes? I am thinking to look into it in 4 hours or so.

lqd (Jan 09 2020 at 08:56, on Zulip):

yeah, the rest of my (local) WIP isn't big and can be rebased easily

Vytautas Astrauskas (Jan 09 2020 at 09:12, on Zulip):

Could you still please push it to some branch?

Vytautas Astrauskas (Jan 09 2020 at 09:13, on Zulip):

I would like to restructure code a bit to make it easier to maintain, which would make your changes impossible to rebase.

lqd (Jan 09 2020 at 10:17, on Zulip):

@Vytautas Astrauskas I don't have access to this computer for a few days :/ go ahead don't worry about it, I'll take care of that afterwards, it was mostly about filtering index uses (so that random variable renaming would not generate duplicate useless indices)

lqd (Jan 09 2020 at 10:17, on Zulip):

I also wanted to make structural changes so that it's also easier to test in isolation but haven't started yet

Vytautas Astrauskas (Jan 09 2020 at 10:22, on Zulip):

OK. Thanks!

Vytautas Astrauskas (Jan 09 2020 at 10:23, on Zulip):

Let's see how far I get :smile:.

lqd (Jan 09 2020 at 10:43, on Zulip):

good luck :D

lqd (Jan 09 2020 at 10:52, on Zulip):

(and also thanks <3)

Last update: Jan 23 2020 at 23:00UTC